MySQL ssl setup failed

MySQLssl

I am following word by word of http://dev.mysql.com/doc/refman/5.0/en/creating-ssl-certs.html for creating SSL certificates to setup SSL enable replication but it is not working for me. Steps which I am following:

  1. Using above reference I have created all required certificates in /var/opt/mysql_certs/
  2. Changed the ownership of all the certificates chown -R mysql:mysql /var/opt/mysql_certs

  3. Then I edited my /etc/my.conf and put these 3 lines in mysqld section:

    ssl-ca=/var/opt/mysql_certs/ca-cert.pem
    ssl-cert=/var/opt/mysql_certs/server-cert.pem
    ssl-key=/var/opt/mysql_certs/server-key.pem
    
  4. Lastly I am restarting mysqld with /etc/init.d/restart mysqld. But, I am getting following errors:

    [Warning]: Failed to setup SSL`
    [Warning] SSL error: SSL_CTX_set_default_verify_paths failed
    

FYI: OS is centOS 6.

Best Answer

I recently solved this issue on my own system and it turned out to be SELinux blocking the reads for the certificates. I fixed my problem by running a restorecon -v /path/to/certs/* but it could also be solved by disabling selinux by running setenforce 0 or by editing the /etc/selinux/config file and setting 'SELINUX=DISABLED'.

If you haven't disabled SELinux already that is.