php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49234 method not found ssl_set
Submitted: 2009-08-12 11:04 UTC Modified: 2010-04-15 13:12 UTC
From: thalashir at gmail dot com Assigned: mysql (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.3.0 OS: windows xp
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: thalashir at gmail dot com
New email:
PHP Version: OS:

 

 [2009-08-12 11:04 UTC] thalashir at gmail dot com
Description:
------------
When I try to connect to a Mysql database using SSL and mysqli, it says that the method ssl_set don't exists. I used function get_class_methods(mysqli) and is not listed. I checked mysql support, mysqli support and openssl support with phpinfo and they are all supported.

Here is the list returned from get_class_methods:
autocommit
change_user
character_set_name
client_encoding
close
commit
connect
dump_debug_info
debug
get_charset
get_client_info
get_connection_stats
get_server_info
get_warnings
init
kill
multi_query
mysqli
more_results
next_result
options
ping
prepare
query
real_connect
real_escape_string
poll
reap_async_query
escape_string
real_query
rollback
select_db
set_charset
set_opt
stat
stmt_init
store_result
thread_safe
use_result
refresh

Reproduce code:
---------------
$mysqli= mysqli_init();

if (!$mysqli) {
	die('mysqli_init failed');
}

$mysqli->ssl_set('path/to/key.pem','path/to/cert.pem','path/to/cacert.pem',null,null);

$mysqli_real_connect('1.2.3.4','ssluser','sslpassword','db',port,MYSQLI_CLIENT_SSL);

//queries

$mysqli->close();

Expected result:
----------------
A secure connection to mysql

Actual result:
--------------
Fatal error: Call to undefined method mysqli::ssl_set() in ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-12 12:26 UTC] pajoye@php.net
It is not available with mysqlnd. No idea why, assigned to the mysql team :)
 [2009-08-13 09:31 UTC] Thalashir at gmail dot com
Ok, thanks. Any suggestions how could I do the connection? I tried with $mysqli->options(MYSQLI_READ_DEFAULT_FILE,'/path/to/cert_my.cnf');
where cert_my.cnf is

ssl-ca='path/to/cacert.pem'
ssl-cert='path/to/cert.pem'
ssl-key='path/to/key.pem'

but denies access to user.

Tried to access via mysql command line with options --ssl-ca=... --ssl-cert=... --ssl-key...  and it works.
 [2009-08-27 08:57 UTC] andrey@php.net
5.3 + mysqlnd doesn't support SSL (as well as compression). If you need to use SSL then you have to use 5.3 + libmysql.
This is a feature request, more or less.
 [2010-04-15 13:01 UTC] andrey@php.net
Automatic comment from SVN on behalf of andrey
Revision: http://svn.php.net/viewvc/?view=revision&revision=298023
Log: Fix for bug#49234 method not found ssl_set
Patch was tested and compiles on Windows. (Thanks Kalle)
 [2010-04-15 13:12 UTC] andrey@php.net
-Status: Assigned +Status: Closed
 [2010-04-15 13:12 UTC] andrey@php.net
Fixed in 5.3.3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC