If you are trying to use and older version of PHP to connect MYSQL over SSL, there is a good chance that you encounter the following errors:
error:0607A082:digital envelope routines:EVP_CI PHER_CTX_set_key_length:
error:0906D06C:PEM routines:PEM_read_bio:no start line
This is a bug in PHP, OpenSSL. This bug has been fixed in PHP versions > 7.1.
In case you are stuck with the older version of the PHP, here is a workaround:
You will need to add the following line before any prepare/query command.
This will clear the previous openssl error.
openssl_error_string(); $db->prepare('SELECT * from test');
openssl_error_string(); $db->query('SELECT * from test');
Hope this helps.