diff --git a/includes/database/database.inc b/includes/database/database.inc
index cae50fb..012f8df 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -194,7 +194,7 @@ abstract class DatabaseConnection extends PDO {
 
   /**
    * The key representing this connection.
-   * 
+   *
    * The key is a unique string which identifies a database connection. A
    * connection can be a single server or a cluster of master and slaves (use
    * target to pick between master and slave).
@@ -307,6 +307,13 @@ abstract class DatabaseConnection extends PDO {
     if (!empty($this->statementClass)) {
       $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array($this->statementClass, array($this)));
     }
+    // If any pdo attributes have been specified in the connection options,
+    // enforce them now.
+    if (!empty($this->connectionOptions['pdo attributes'])) {
+      foreach ($this->connectionOptions['pdo attributes'] as $attribute => $value) {
+        $this->setAttribute($attribute, $value);
+      }
+    }
   }
 
   /**
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 40f552e..bd53bef 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -89,6 +89,27 @@
  * varies by driver.  For MySQL, the default is FALSE since MyISAM tables
  * do not support transactions.
  *
+ * Drupal database layer is based on PDO, you can pass any arbitrary driver
+ * option that is supported by the database engine by passing them to the
+ * 'driver options' array. The keys of this array are driver names, values
+ * are the corresponding values. You can also set arbitrary PDO attributes
+ * that will be enforced when the connection to the database is established
+ * using the 'pdo attributes' array with the same format:
+ * @code
+ * 'pdo attributes' => array(
+ *   // Set the timeout to 1 second, instead of the default 30 seconds.
+ *   PDO::ATTR_TIMEOUT => 1,
+ * ),
+ * 'driver options' => array(
+ *   MYSQL_ATTR_SSL_KEY => '/path/to/key.pem',
+ *   MYSQL_ATTR_SSL_CERT => '/path/to/cert.pem',
+ *   MYSQL_ATTR_SSL_CA => '/path/to/ca-cert.pem',
+ *   // Optional
+ *   MYSQL_ATTR_SSL_CAPATH => '/ca/path',
+ *   MYSQL_ATTR_SSL_CIPHER => 'ssl cipher',
+ * ),
+ * @endcode
+ *
  * For each database, you may optionally specify multiple "target" databases.
  * A target database allows Drupal to try to send certain queries to a
  * different database if it can but fall back to the default connection if not.
@@ -121,6 +142,16 @@
  *   'host' => 'localhost',
  *   'prefix' => 'main_',
  *   'collation' => 'utf8_general_ci',
+ *   'pdo attributes' => array(
+ *     // Set the timeout to 1 second, instead of the default 30 seconds.
+ *     PDO::ATTR_TIMEOUT => 1,
+ *   ),
+ *   // For SSL Connection
+ *   'driver options' => array(
+ *     MYSQL_ATTR_SSL_KEY => '/path/to/key.pem',
+ *     MYSQL_ATTR_SSL_CERT => '/path/to/cert.pem',
+ *     MYSQL_ATTR_SSL_CA => '/path/to/ca-cert.pem',
+ *   ),
  * );
  * @endcode
  *
@@ -159,7 +190,7 @@
  *     'sessions'  => 'shared.',
  *     'role'      => 'shared.',
  *     'authmap'   => 'shared.',
- *   );
+ *   ),
  * @endcode
  * NOTE: MySQL and SQLite's definition of a schema is a database.
  *
@@ -196,6 +227,20 @@
  *     'host' => 'localhost',
  *     'prefix' => '',
  *   );
+ *   // mysql with SSL
+ *   $databases['default']['default'] = array(
+ *     'driver' => 'mysql',
+ *     'database' => 'databasename',
+ *     'username' => 'username',
+ *     'password' => 'password',
+ *     'host' => 'localhost',
+ *     'prefix' => '',
+ *     'driver options' => array(
+ *       MYSQL_ATTR_SSL_KEY => '/etc/ssl/mysql/key.pem',
+ *       MYSQL_ATTR_SSL_CERT => '/etc/ssl/mysql/cert.pem',
+ *       MYSQL_ATTR_SSL_CA => '/etc/ssl/mysql/ca-cert.pem',
+ *     ),
+ *   );
  *   $databases['default']['default'] = array(
  *     'driver' => 'pgsql',
  *     'database' => 'databasename',
