php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76388 CURLOPT_SSLKEYPASSWD is not supported when curl is compiled with NSS
Submitted: 2018-05-29 10:00 UTC Modified: 2019-01-02 00:49 UTC
Votes:9
Avg. Score:4.6 ± 0.7
Reproduced:9 of 9 (100.0%)
Same Version:5 (55.6%)
Same OS:4 (44.4%)
From: samuel dot chemla at orange dot com Assigned:
Status: Open Package: cURL related
PHP Version: 7.2.6 OS: linux rhel
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git 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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: samuel dot chemla at orange dot com
New email:
PHP Version: OS:

 

 [2018-05-29 10:00 UTC] samuel dot chemla at orange dot com
Description:
------------
Making a request with curl and a client certificate won't work if the client certificate key is ciphered.

Curl will generate an error:
curl error (58): unable to load client key: -8178 (SEC_ERROR_BAD_KEY) 

It seems this is due to curl compiled with NSS because with curl compiled with openssl it works

If this is correct please could you update the documentation to warn about this?

Test script:
---------------
curl_setopt($ch, CURLOPT_SSLCERT,       "<path to client PEM cert>");
curl_setopt($ch, CURLOPT_SSLKEY,        "<path to client PEM key>");
curl_setopt($ch, CURLOPT_SSLKEYPASSWD,  "password");




Expected result:
----------------
The client certificate should be presented to remote

Actual result:
--------------
If the private key begins with:
-----BEGIN PRIVATE KEY-----
--> it will work

If it begins with:
-----BEGIN ENCRYPTED PRIVATE KEY-----
--> it will generate "curl error (58): unable to load client key: -8178 (SEC_ERROR_BAD_KEY)"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-02 00:49 UTC] girgias@php.net
-Package: Documentation problem +Package: cURL related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 11:01:30 2024 UTC