Support » Installing WordPress » WordPress with Mysql over SSL

  • Hi,

    I have had a search and couldn’t find anything

    I have a database server that is in a different location to my two web servers, I want to use SSL to encrypt the connections between the DB server and the web server is this possible in WordPress?. I do not want to use SSH tunnels as it’s just not a /nice/ solution

    Thanks,
    Will

Viewing 1 replies (of 1 total)
  • here you are 🙂

    $ svn diff ./wp-includes/wp-db.php
    Index: wp-includes/wp-db.php
    ===================================================================
    --- wp-includes/wp-db.php       (wersja 15639)
    +++ wp-includes/wp-db.php       (kopia robocza)
    @@ -1025,9 +1025,13 @@
             */
            function db_connect() {
                    global $db_list, $global_db_list;
    +
    +                if(defined('DB_SSL') && DB_SSL === true ){
    +                    $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true , MYSQL_CLIENT_SSL);
    +                }else{
    +                    $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
    +                }
    
    -               $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
    -
                    if ( !$this->dbh ) {
                            $this->bail( sprintf( /*WP_I18N_DB_CONN_ERROR*/"
     <h1>Error establishing a database connection</h1>

    IMPORTANT: add to your wp-config.php line:
    define('DB_SSL', true);

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress with Mysql over SSL’ is closed to new replies.