PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #28075 mysql ssl connection
Submitted:20 Apr 2004 12:34pm UTC Modified: 20 Apr 2004 3:54pm UTC
From:petre dot rodan at avira dot com Assigned to:georg
Status:Assigned Category:Feature/Change Request
Version:4.3.6 OS:linux
Votes:4 Avg. Score:4.5 ± 0.5 Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%) Same OS:3 (100.0%)
View/Vote Add Comment Developer Edit Submission

Welcome! If you don't have a SVN account, you can't do anything here. You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
SVN Username: SVN Password:
Quick Fix:
Status: Assign to:
Category:
Summary:
From: petre dot rodan at avira dot com
New email:
Version: OS:
New/Additional Comment:

[20 Apr 2004 12:34pm UTC] petre dot rodan at avira dot com
Description:
------------
I was tring to use SSL-enabled mysql connections using php and mod_php.

The problem was that the libmysql library inside {,mod_}php detects that
SSL is needed, but it doesn't know the location of the client
certificate.

by simply inserting the following line 
mysql_options(&mysql->conn,MYSQL_READ_DEFAULT_GROUP,"client");
before mysql_real_connect(..) in ext/mysql/php_mysql.c, the my.cnf file
is read and all SSL-related configurations are imported from there.

If my problem can be solved in another way, please drop me a line :).

Successfuly tested with php-4.3.4-r4, mod_php-4.3.4-r4,
mod_php-4.3.6-rc2, php-5.0_beta1-r1.

see
http://bugs.gentoo.org/show_bug.cgi?id=46340#c3
for scenario details

the patch can be downloaded here:
http://bugs.gentoo.org/attachment.cgi?id=28436&action=view

[20 Apr 2004 3:54pm UTC] derick@php.net
Assigning to georg, the maintainer of this extension.
[13 Jul 2007 10:45am UTC] Bruno dot Harbulot at manchester dot ac dot uk
I have just tried this suggestion (using mysql_options to read the
[client] section of the global mysql configuration file). It works.
However, it doesn't seem like a good idea to use a global client
configuration for all the MySQL connections from PHP. There can be
scenarios where different certificates or CAs might be required.

Perhaps it would be better to have a binding of mysql_ssl_set (part of
the MySQL API) to the PHP MySQL extension. It seems that MySQLi supports
it.

See:
http://dev.mysql.com/doc/refman/5.0/en/mysql-ssl-set.html
http://www.php.net/manual/en/function.mysqli-ssl-set.php

Regards,

Bruno.

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC