I'm running PHP 5.6.11 on Apache 2.2 with OpenSSL 1.0.1 on Ubuntu 12. I've sucessfully setup SSL in Apache and MySQL.
Now I want to set up a PHPMyAdmin and connect it through SSL. I don't really need it on localhost, but I dont have another way to check if my setup is working properly. So, instead of connecting PMA to "localhost" I have connected it to my domain "mx.testdomain.com". This opens a TCP connection and does not use the normal socket (I couldn't get SSL to work with the socket).
When I log in my PMA, I get the following error message:
Error
SELECT * FROM information_schema.CHARACTER_SETS
MySQL reports:
# 2006 - MySQL server has gone away
When I deactivate SSL in my PMA config, everything works fine but I get the following "Backtrace Errors" the first time I login:
Warning in ./libraries/dbi/DBIMysqli.class.php#236 mysqli_select_db(): SSL operation failed with code 1.
OpenSSL Error messages: error:0607A082:digital envelope routines:EVP_CIPHER_CTX_set_key_length:invalid key length error:0607A082:digital envelope routines:EVP_CIPHER_CTX_set_key_length:invalid key length
I use the same SSL certificate for Apache and MySQL.
When I run this PHP Command, it returns a Valid Cipher:
$link = mysql_connect("mx.testdomain.com","testadmin","testpassword",false,MYSQL_CLIENT_SSL)
or die(mysql_error());
$res = mysql_query("SHOW STATUS LIKE 'ssl_cipher';",$link);
print_r(mysql_fetch_row($res));
echo "Finished.";
Output:
Array (
[0] => Ssl_cipher
[1] => AES256-SHA ) Finished.
When I check my URL with file_get_contents I have the following output:
array(4) {
["protocol"]=> string(7) "TLSv1.2"
["cipher_name"]=> string(25) "DHE-RSA-AES256-GCM-SHA384"
["cipher_bits"]=> int(256)
["cipher_version"]=> string(11) "TLSv1/SSLv3"
}