I need to establish an SSL connection to my PHP-PDO web application. I have MySQL workbench 5.7 and I don't know how and where to start.
I saw different posts online explaining how to do that using mysqld
and shell>
like 6.4.4 Configuring MySQL to Use Secure Connections and 5.3.4 SSL Wizard (Certificates) in the manual.
I changed the connection to:
$conn = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass, array(
PDO::MYSQL_ATTR_SSL_KEY =>'/etc/mysql/ssl/client-key.pem',
PDO::MYSQL_ATTR_SSL_CERT=>'/etc/mysql/ssl/client-cert.pem',
PDO::MYSQL_ATTR_SSL_CA =>'/etc/mysql/ssl/ca-cert.pem'
));
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$conn->exec("SET CHARACTER SET utf8mb4");
Then I went to MySQL workbench and clicked on Database → Connect To Database → SSL Tab → SSL Wizard. I checked Use default Parameters
, and I've got this error:
OpenSSL Win64 is installed at C:\OpenSSL-Win64
.
What is the problem and how do I fix it?