0

I am trying to use curl for windows and install the curl and also set an environment variable to use curl windows. But when I tried to make a connection with salesforce org it will give me an SSL error.

* Trying 101.53.160.130... * TCP_NODELAY set * Connected to
login.salesforce.com (101.53.160.130) port 443 (#0) * ALPN, offering 
http/1.1 * Cipher selection: 
ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * TLSv1.2 (OUT), 
TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Client 
hello (1): * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), 
TLS handshake, Certificate (11): * TLSv1.2 (OUT), TLS alert, Server hello 
(2): * SSL certificate problem: unable to get local issuer certificate * 
Closing connection 0 * TLSv1.2 (OUT), TLS alert, Client hello (1): curl: 
(60) SSL certificate problem: unable to get local issuer certificate More 
details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify 
the legitimacy of the server and therefore could not establish a secure 
connection to it. To learn more about this situation and how to fix it, 
please visit the web page mentioned above. C:\Users\Ram Briskminds>curl -v 
https://login.salesforce.com/services/oauth2/token -d "grant_type=password" 
-
d"client_id=3MVG9ZL0ppGP5UrB5_qzjV.qZP1**************I91mu
wsXIfsN5IvgeFasoi" -d "client_secret=803**************95" -d 
"username=**********" -d "password=**************" -H 'X-
PrettyPrint:1' * Trying 101.53.163.2... * TCP_NODELAY set * Connected to 
login.salesforce.com (101.53.163.2) port 443 (#0) * ALPN, offering http/1.1 
* Cipher selection: 
ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * TLSv1.2 (OUT), 
TLS header, Certificate Status (22): * TLSv1.2 (OUT), TLS handshake, Client 
hello (1): * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), 
TLS handshake, Certificate (11): * TLSv1.2 (OUT), TLS alert, Server hello 
(2): * SSL certificate problem: unable to get local issuer certificate * 
Closing connection 0 * TLSv1.2 (OUT), TLS alert, Client hello (1): curl: 
(60) SSL certificate problem: unable to get local issuer certificate More 
details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify 
the legitimacy of the server and therefore could not establish a secure 
connection to it. To learn more about this situation and how to fix it, 
please visit the web page mentioned above.

can anyone please let me know the fix for the following. Thanks in advance.

5
  • Which version of Curl you are using?
    – Saroj Bera
    Mar 7, 2018 at 10:37
  • @SarojBera I'm using version curl-7.58.0 and also don't see any ca-bundle.crt file. Mar 8, 2018 at 4:08
  • You can download the .pem file and rename it as mentioned in this thread superuser.com/questions/442793/…
    – Saroj Bera
    Mar 8, 2018 at 9:41
  • @SarojBera I already download the .pem file but I didn't get the desired result still show the same error. May the location of a .pem file is the problem or maybe some certificate issue. Thanks for Response...... Mar 8, 2018 at 9:58
  • Your download file should have this ca-cert-bundle.crt file. just check whether this file is present in the same location where your curl.exe is present.
    – Saroj Bera
    Mar 8, 2018 at 10:29

2 Answers 2

1

Salesforce has disabled older version of TLS, it looks like you are using old TLS.

For some version of CURL you cannot connect using TLS1.2 unless you explicitly specify. You can do that using --tlsv1.2 attribute. You curl command will look like.

curl -v --tlsv1.2
https://login.salesforce.com/services/oauth2/token -d "grant_type=password" 
-
d"client_id=3MVG9ZL0ppGP5UrB5_qzjV.qZP1**************I91mu
wsXIfsN5IvgeFasoi" -d "client_secret=803**************95" -d 
"username=**********" -d "password=**************" -H 

Source: https://github.com/curl/curl/issues/700

4
  • Hi Pranay, I tried this but it will give me a same error. Mar 7, 2018 at 10:28
  • How do you figure that it's an issue of using outdated TLS? The provided logs contain nothing but "TLSv1.2"
    – Derek F
    Mar 7, 2018 at 13:37
  • @DerekF still I didn't figure out what the actual issue is and I already shared the whole logs. Mar 8, 2018 at 4:10
  • While I eventually got the same error, this appeared to progress the issue some. I got "curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above. * Could not resolve host: application * Closing connection 1 curl: (6) Could not resolve host: application " Mar 12, 2018 at 18:21
1

I think the issue is related to the .crt file present in your local machine. Check the log you can see this * SSL certificate problem: unable to get local issuer certificate *.

If it is correct it will say like this

* successfully set certificate verify locations:
*   CAfile: C:\Users\saroj.bera\Desktop\curl_7_53_1_openssl_nghttp2_x64\ca-bundle.crt

My Curl location

enter image description here

Try to download Curl again and check.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .