Unable To Set Private Key File

💣 👉🏻👉🏻👉🏻 ALL INFORMATION CLICK HERE 👈🏻👈🏻👈🏻
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.2k●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.2k●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 321●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
Visa Developer Community
Forums
Sandbox & Test Data
Curl error: unable to set private key file: 'C:......
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark
Subscribe
Printer Friendly Page
Curl error: unable to set private key file: 'C:.....privateKey.pem' type PEM
SOLVED
Curl error: unable to set private key file: 'C:.....privateKey.pem' type PEM
I have this error When I run the api "funds_transfer_api" in my local with XAMPP, using its files in PHP :
---------------------------------------------------------
Curl error: unable to set private key file: 'C:\xampp7\htdocs\PROYECTOS_2020\diego_visadirect\visa_direct\funds_transfer_api\privateKey.pem' type PEM
---------------------------------------------------------
I follow the tutorial in his page and I generate the "privateKey.pem" and I get the "cert.pem", and in his manual in PHP I set this certificates for use the API, but I get the error.
I tryed use the function cURL how show the page of PHP, and I get the same error. This is the code :
Re: Curl error: unable to set private key file: 'C:.....privateKey.pem' type PEM
I fixed my problem, when a create my own private.key to create my cert.pem don´t work but When I generate automatically with the page of visa (the private key) its work. and Also work when i do method GET .
When I do POST. I copy the sample parameters that show visa developer, but show an error
string(141) "{"responseStatus":{"code":"9501","severity":"ERROR","message":"Invalid input found, please correct the input data","info":"","status":"400"}}"
I think that I should change the structure the sample parametres of visa:
Re: Curl error: unable to set private key file: 'C:.....privateKey.pem' type PEM
Great to hear that you have fixed your private key issue.
I tried the parameters that you were using and copied it to my testing tool and I was able to get a response successfully. Here's my post request and response:
End Point https://sandbox.api.visa.com/visadirect/fundstransfer/v1/pullfundstransactions
Method POST
Request
{
"amount": "124.02",
"localTransactionDateTime": "2020-07-15T02:46:25",
"cardAcceptor": {
"address": {
"country": "USA",
"zipCode": "94404",
"county": "081",
"state": "CA"
},
"idCode": "ABCD1234ABCD123",
"name": "Visa Inc. USA-Foster City",
"terminalId": "ABCD1234"
},
"acquirerCountryCode": "840",
"acquiringBin": "408999",
"retrievalReferenceNumber": "330000550000",
"senderCurrencyCode": "USD",
"addressVerificationData": {
"street": "XYZ St",
"postalCode": "12345"
},
"systemsTraceAuditNumber": "451001",
"businessApplicationId": "AA",
"senderPrimaryAccountNumber": "4895142232120006",
"foreignExchangeFeeTransaction": "11.99",
"senderCardExpiryDate": "2015-10"
}
Response
{
"transmissionDateTime": "2020-07-15T18:33:28.000Z",
"approvalCode": "98765X",
"cpsAuthorizationCharacteristicsIndicator": "3333",
"transactionIdentifier": 623422177635620,
"actionCode": "00",
"responseCode": "5"
}
Response Header
Status Code: 200 OK
Server : nginx
Date : Wed, 15 Jul 2020 18:33:28 GMT
Content-Type : application/json;charset=UTF-8
Content-Length : 202
Connection : keep-alive
X-SERVED-BY : l55c014
X-CORRELATION-ID : 1594838008_500_923262086_l55c014_VDP_WS
X-APP-STATUS : 200
X-APP-STATUS : 200
X-Backside-Transport : OK OK,OK OK
X-Global-Transaction-ID : 1adcbd165f0f4bf8f2d78181
X-Frame-Options : SAMEORIGIN
X-XSS-Protection : 1; mode=block
X-Content-Type-Options : nosniff
Strict-Transport-Security : max-age=2592000;includeSubdomains
Cache-Control : no-cache, no-store, must-revalidate
Pragma : no-cache
Expires : -1
Content-Language : en-US
I was using the VDC Playground tool to test. It can be downloaded from your project asset page. Details can be found here: https://community.developer.visa.com/t5/Developer-Tools/How-to-test-and-troubleshoot-APIs-with-the-V...
Best,
Stacey
Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
Re: Curl error: unable to set private key file: 'C:.....privateKey.pem' type PEM
Thanks ! , I had to convert the structure JSON in structure array associative and create a variable for save it. And I get the response.
Have Visa Direct a commision ? and if is it true, how many is the commission ? I need to transference of my count to diferents cards count.
Re: Curl error: unable to set private key file: 'C:.....privateKey.pem' type PEM
There is no cost to you to use Visa Direct APIs in the sandbox. When you are ready to transition to production use of the Visa Direct APIs, there are fees for each of the APIs that are used. Fees are evaluated by application, as they are a function of many elements, including the nature of your application and your relationship with any existing Visa partner(s). We treat production applications on a case-by-case basis and work with you to determine appropriate pricing. Please navigate to the below link for additional information on Visa Developer pricing.
Currently, only Visa accounts can receive push payments from Visa Direct. Please navigate to the below link for information on what account types can receive Visa Direct payments/transfers.
Best,
Stacey
Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
Copyright 2015–2021 Visa. All rights reserved.
We are actively updating this site to accommodate AA compliance for accessibility.
We use cookies to give you the best online experience, measure your visits to our sites and to enable marketing activities (including with our marketing partners). For details, see the Visa Cookie Notice.
Marketing, personalization and advertising
Xxx Negri Download
Reddit Com R Milf
Www Young Girl Com
Hailey Queen Anal
Anal Fist Tube
curl: (58) unable to set private key file: 'server.key ...
Solved: Curl error: unable to set private key file: 'C ...
unable to set private key file | WordPress.org
unable to set private key file: t… | Apple Developer Forums
Unable to set private key file · Issue #113 · davibennun ...
“unable to set private key file: ‘Swish.pem’ type PEM ...
warning: stream_socket_client(): unable to set private key ...
2014-03-26:curl: (58) unable to set private key file
Curl: curl: (58) unable to set private key file ...
Unable To Set Private Key File





















































