Page 1 of 1

PHP mysql_connect ssl

PostPosted: 09. November 2007 14:10
by scottbird7
I've tried to troubleshoot this as much as I can before registering and posting.

I have an application running under xampp 1.6.4 (Windows) written in php which accesses a remote database. The web page is https so I know that ssl is working fine for the apache server. The application works fine when I access the database server using the default mysql_connect form, but fails when I use the MYSQL_CLIENT_SSL flag. I've verified that my.cnf has the client key and certificate along with the ca cert. The mysql command line client can connect to the server using the certificate so it looks like an issue with the php mysql client or I've missed something in the configuration.
Any assistance would be greatly appreciated as I cannot use the unsecured database connection except for testing purposes.
Thanks in advance - and for such a wonderful package as well!
Scott

PostPosted: 09. November 2007 14:21
by Wiedmann
PHP mysql_connect ssl

Use the mysqli extension for SSL (and not the mysql extension).

mysqli

PostPosted: 09. November 2007 14:34
by scottbird7
Thanks. That may be a problem with one of our servers, but I may be able to get around it using replication until it can be upgraded. We use the os standard distributions from Red Hat which often lag the distribution releases and NEVER seem to move forward ;)
Thanks again,
Scott

success!

PostPosted: 09. November 2007 18:14
by scottbird7
And there was much rejoicing...
Curious question - why is the ssl option not available in the build of the php mysql extension?
I ask only because, although I was able to rewrite my code to make it work, the red hat distribution worked with the code as it was.
Just curious...
Thanks again!
Scott