php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50614 Certificate private key
Submitted: 2009-12-30 22:51 UTC Modified: 2009-12-31 17:51 UTC
From: dimarikson at yandex dot ru Assigned:
Status: Not a bug Package: OpenSSL related
PHP Version: 5.2.12 OS: FreeBSD 7, Windows XP
Private report: No CVE-ID: None
 [2009-12-30 22:51 UTC] dimarikson at yandex dot ru
Description:
------------
Setting curl certificate option "CURLOPT_SSLCERT" arrouse checking of a private key and throws an error if key is not valid or empty: "(58) unable to set private key file". 

But many sites do not provide private key at all (i.e. only outgoing data being encrypted). So this makes impossible to communicate with these sites through php.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-31 13:01 UTC] dimarikson at yandex dot ru
Actually this is not a bug. May be a misfunction. I found this in a curl source code:

if(SSL_CTX_use_PrivateKey_file(ctx, key_file, file_type) != 1) {
failf(data, "unable to set private key file: '%s' type %s",
key_file, key_type?key_type:"PEM");

Also I have found a solution how to avoid this. I have used "OpenSSL" library and "fsockopen" to manually encrypt and send the request. May be this is a bit offtopic, but I guess it can help someone.
 [2009-12-31 17:51 UTC] jani@php.net
You should report curl bugs at:
 
 http://sourceforge.net/tracker/?group_id=976&atid=100976
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 08:01:36 2025 UTC