Unable To Set Private Key File

Unable To Set Private Key File




💣 👉🏻👉🏻👉🏻 ALL INFORMATION CLICK HERE 👈🏻👈🏻👈🏻




















































This took me far too long to work out.
I kept getting the following error whilst trying to sign a cURL request:
curl: (58) unable to set private key file: 'server.key' type PEM
Google kept sending me to this StackOverflow page which is correct, but was not the issue that I was having. I tried placing both key and cert in one file and using --cert, and using separate files and sending --cert and --key. The actual issue is that I was sending the wrong certificate file. This meant that cURL was looking for a private key that belongs to that certificate and couldn't find it (leading the to above error)
To ensure that your certificate and key match, you can use the following commands:
$ openssl x509 -noout -modulus -in server.crt | openssl md5
$ openssl rsa -noout -modulus -in server.key | openssl md5
You should see something that looks like the following:
(stdin)= 47f0c86371b31432504f195357cf2947

If the two values don't match, you're not using the correct combination.

Sign up or log in to view your list.
I'm trying to connect to a remote host using cURL. The connection requires the use of a certificate and a private key which is password protected. So far I'm unsuccessful with this code below:
The result I keep getting is error 58: unable to set private key file: '/home/.../domains/.../public_html/auth/key.pem' type PEM.
I'm pretty sure the problem lies somehwere in my configuration, but I'm not sure where to look.
Ben Fransen
Ben Fransen 10.3k●1616 gold badges●6767 silver badges●125125 bronze badges
"Switch the order of the content in the key.pem". You key.pem file (which contains the private key) should only really contain 1 PEM-encoded section (for the private key). It's the order of the cert file you might need to change. The client-cert for this private key should be at the top. – Bruno Nov 24 '14 at 10:51
I've fixed this problem. I think, due to the number of questions regarding this issue and number of different solutions, others will benefit from the solution. Here goes:
I used the openssl CLI program to convert the .p12 key-file to a .pem key-file. The trick is the way the conversion takes place.
First I converted it with this command and I had the issue as described in the question:
openssl pkcs12 -in key.p12 -out key.pem -nodes -clcerts
While the command below did the actual trick:
openssl pkcs12 -in key.p12 -out key.pem -clcerts
For more info please see the source I used: https://community.qualys.com/docs/DOC-3273
Ben Fransen
Ben Fransen 10.3k●1616 gold badges●6767 silver badges●125125 bronze badges
-nodes removes the encryption on the key, which may conflict with you trying to use a password in this case. – Bruno Nov 24 '14 at 12:48
Thanks for the additional info. I wasn't aware of that. – Ben Fransen Nov 25 '14 at 8:44
Did the trick for me! After days of being stuck on this! Thank You – S.Simkhada May 20 '19 at 9:35
Just in case this is useful to others searching for this problem, I ended up discovering that CURLOPT_SSLCERT and CURLOPT_SSLKEY don't seem to work with relative paths.
This is with WAMP, php version 5.5 on Windows.
jgibbs
jgibbs 331●33 silver badges●1111 bronze badges
Click here to upload your image (max 2 MiB)
You can also provide a link from the web.
By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy
2021 Stack Exchange, Inc. user contributions under cc by-sa
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Accept all cookies Customize settings

Lesbians Orgasm Threesome
Naked Ass On A Scene
Lesbians Pissing Complexion
Stocking Women Ass
Hentai Femdom School
curl: (58) unable to set private key file: 'server.key ...
Solved: Re: Curl error: unable to set private key file: 'C ...
PHP SoapClient Warning: SoapClient::SoapClient(): Unable ...
php - stream_socket_client(): Unable to set private key ...
Работало и перестало.. cURL Error: unable to set private ...
unable to set private key file | WordPress.org
Curl: curl: (58) unable to set private key file ...
微信退款证书报错 Unable to set private key file · Issue #492 ...
Curl: unable to set private key file
Unable To Set Private Key File


Report Page