Edit report at http://bugs.php.net/bug.php?id=41778&edit=1

 ID:               41778
 Updated by:       and...@php.net
 Reported by:      mail at tobias-wassermann dot de
 Summary:          Always get the SSL connection error
-Status:           No Feedback
+Status:           Feedback
 Type:             Bug
 Package:          MySQLi related
 Operating System: Windows XP
 PHP Version:      5.2.5
-Assigned To:      andrey
+Assigned To:      mysql

 New Comment:

Hi,

I see you use 5.2.5, can you try 5.3 with mysqlnd enabled, from
snaps.php.net?



Thanks,

Andrey


Previous Comments:
------------------------------------------------------------------------
[2010-04-24 21:41:09] extramobile at gmail dot com

When i connect like this:

$mysqli -> ssl_set('client-key.pem', 'client-cert.pem', 'ca-cert.pem',
null, null );

(..)

$mysqli -> real_connect( 'localhost', 'ssluser', 'sslpass', 'apps',
3306, null, MYSQLI_CLIENT_SSL );



SHOW VARIABLES LIKE "%SSL%";



returns nothing because of:

Warning: mysqli::real_connect() [function.mysqli-real-connect]:
(HY000/2026): SSL connection error in D:\web\xampp\htdocs\init\init.php 
on line 70

Warning: mysqli::query() [function.mysqli-query]: invalid object or
resource mysqli in D:\web\xampp\htdocs\init\init.php on line 72





But when I connect:



$mysqli -> ssl_set('client-key.pem', 'client-cert.pem', 'ca-cert.pem'
);



it gives me:



Warning: mysqli::ssl_set() expects exactly 5 parameters, 3 given in
D:\web\xampp\htdocs\init\init.php on line 59

Array ( [Variable_name] => have_openssl [Value] => YES )

Array ( [Variable_name] => have_ssl [Value] => YES )

Array ( [Variable_name] => ssl_ca [Value] => ca-cert.pem )

Array ( [Variable_name] => ssl_capath [Value] => )

Array ( [Variable_name] => ssl_cert [Value] => server-cert.pem )

Array ( [Variable_name] => ssl_cipher [Value] => )

Array ( [Variable_name] => ssl_key [Value] => server-key.pem ) 



i have xampp apache friends 1.6.4



I connect via CMD by 

mysql --ssl-ca=ca-cert.pem --ssl-cert=client-cert.pem
--ssl-key=client-key.pem -ussluser -p



and SHOW VARIABLES LIKE "%SSL%";

+---------------+-----------------+

| Variable_name | Value           |

+---------------+-----------------+

| have_openssl  | YES             |

| have_ssl      | YES             |

| ssl_ca        | ca-cert.pem     |

| ssl_capath    |                 |

| ssl_cert      | server-cert.pem |

| ssl_cipher    |                 |

| ssl_key       | server-key.pem  |

+---------------+-----------------+

7 rows in set (0.00 sec)

------------------------------------------------------------------------
[2008-11-10 01:00:04] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2008-11-02 12:47:00] j...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------
[2008-04-22 20:01:24] mail at tobias-wassermann dot de

Hi,



reconstructed the case again - sorry for the delay - with the following
code:



<?php



error_reporting(E_ALL);

ini_set("display_errors", "1");

$conn = mysqli_init();

$conn->ssl_set("C:/proj/test/test.crt", "C:/proj/test/ca.crt",
"C:/proj/test/ca2.crt", NULL, NULL); 

$conn->real_connect("www.iba-ag.com", "user", "pass", "db", 3306, NULL,
MYSQLI_CLIENT_SSL);



echo $conn->errno;

$res = $conn->query("SELECT * FROM catalog");

echo " - COUNT: {$res->num_rows}";

?>



The big BUT: Everytime I connect, I got a connection and the correct
count of the SELECT - it works if the ssl-files exists or not exists. So
it seems to be that never ever a ssl-connection will be established now
- whats the problem?



I tried this with a 5.2.3 PHP on Windows and a 5.2.5 PHP on Linux - in
both cases with enabled OpenSSL-support

------------------------------------------------------------------------
[2008-01-23 13:22:27] johan...@php.net

Could you please try to use the full path instead of just giving the
file name? Thanks.

I can't get that error message.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=41778


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=41778&edit=1

Reply via email to