Index: inc/interface-wp-db-driver.php
===================================================================
--- inc/interface-wp-db-driver.php	(revision 745281)
+++ inc/interface-wp-db-driver.php	(working copy)
@@ -4,7 +4,7 @@
 	public function escape( $string );
 	public function get_error_message();
 	public function flush();
-	public function connect( $host, $user, $pass, $port = 3306 );
+	public function connect( $host, $user, $pass, $port = 3306, $options = array() );
 	public function select( $name );
 	public function query( $query );
 	public function load_col_info();
Index: db.php
===================================================================
--- db.php	(revision 745281)
+++ db.php	(working copy)
@@ -198,8 +198,12 @@
 
 		$this->is_mysql = true;
 
-		$new_link = defined( 'MYSQL_NEW_LINK' ) ? MYSQL_NEW_LINK : true;
-		$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;
+		$options = array();
+		$options['key'] = defined( 'DB_SSL_KEY' ) ? DB_SSL_KEY : null;
+		$options['cert'] = defined( 'DB_SSL_CERT' ) ? DB_SSL_CERT : null;
+		$options['ca'] = defined( 'DB_SSL_CA' ) ? DB_SSL_CA : null;
+		$options['ca_path'] = defined( 'DB_SSL_CA_PATH' ) ? DB_SSL_CA_PATH : null;
+		$options['cipher'] = defined( 'DB_SSL_CIPHER' ) ? DB_SSL_CIPHER : null;
 
 		$host = $this->dbhost;
 		$port = 3306;
@@ -207,7 +211,7 @@
 			list( $host, $port ) = explode( ':', $this->dbhost );
  		}
 
-		if ( !$this->dbh->connect( $host, $this->dbuser, $this->dbpassword, $port ) ) {
+		if ( !$this->dbh->connect( $host, $this->dbuser, $this->dbpassword, $port, $options ) ) {
 			wp_load_translations_early();
 			$this->bail( sprintf( __( "
 <h1>Error establishing a database connection</h1>
Index: drivers/mysqli.php
===================================================================
--- drivers/mysqli.php	(revision 745281)
+++ drivers/mysqli.php	(working copy)
@@ -62,8 +62,19 @@
 	 * Connect to database
 	 * @return bool
 	 */
-	public function connect( $host, $user, $pass, $port = 3306 ) {
+	public function connect( $host, $user, $pass, $port = 3306, $options = array() ) {
 		$this->dbh = new mysqli( $host, $user, $pass, '', $port );
+
+		if ( !empty( $options['key'] ) && !empty( $options['cert'] ) && !empty( $options['ca'] ) ) {
+			$this->dbh->ssl_set(
+				$options['key'],
+				$options['cert'],
+				$options['ca'],
+				$options['ca_path'],
+				$options['cipher']
+			);
+		}
+
 		return ( !mysqli_connect_error() );
 	}
 
Index: drivers/mysql.php
===================================================================
--- drivers/mysql.php	(revision 745281)
+++ drivers/mysql.php	(working copy)
@@ -62,7 +62,7 @@
 	 * Connect to database
 	 * @return bool
 	 */
-	public function connect( $host, $user, $pass, $port = 3306 ) {
+	public function connect( $host, $user, $pass, $port = 3306, $options = array() ) {
 
 		$new_link = defined( 'MYSQL_NEW_LINK' ) ? MYSQL_NEW_LINK : true;
 		$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;
Index: drivers/pdo_mysql.php
===================================================================
--- drivers/pdo_mysql.php	(revision 745281)
+++ drivers/pdo_mysql.php	(working copy)
@@ -75,10 +75,18 @@
 	 * Connect to database
 	 * @return bool
 	 */
-	public function connect( $host, $user, $pass, $port = 3306 ) {
+	public function connect( $host, $user, $pass, $port = 3306, $options = array() ) {
 		$dsn = sprintf( 'mysql:host=%1$s;port=%2$d', $host, $port );
 		try {
-			$this->dbh = new PDO( $dsn, $user, $pass );
+			$pdo_options = array();
+			$pdo_options[PDO::MYSQL_ATTR_SSL_KEY] = $options['key'];
+			$pdo_options[PDO::MYSQL_ATTR_SSL_CERT] = $options['cert'];
+			$pdo_options[PDO::MYSQL_ATTR_SSL_CA] = $options['ca'];
+			$pdo_options[PDO::MYSQL_ATTR_SSL_CAPATH] = $options['ca_path'];
+			$pdo_options[PDO::MYSQL_ATTR_SSL_CIPHER] = $options['cipher'];
+			$pdo_options = array_filter( $pdo_options );
+
+			$this->dbh = new PDO( $dsn, $user, $pass, $pdo_options );
 			$this->dbh->setAttribute ( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
 		} catch ( Exception $e ) {
 			return false;
