Error 60: SSL failed under pycurl, but works under normal curl

From: Jacco van Dorp via curl-and-python <>
Date: Tue, 9 Jan 2018 16:43:05 +0100

System: windows 7.

Pycurl version:
PycURL/ libcurl/7.57.0 OpenSSL/1.1.0g zlib/1.2.11
c-ares/1.13.0 libssh2/1.8.0

curl version:
curl 7.57.0 (x86_64-pc-win32) libcurl/7.57.0 WinSSL zlib/1.2.11

Python code that doesn't work:

import pycurl
from io import BytesIO
buffer = BytesIO()
curl = pycurl.Curl()
curl.setopt(curl.URL, "")
curl.setopt(curl.VERBOSE, 1)
curl.setopt(curl.USERNAME, "somename")
curl.setopt(curl.USERPWD, "mypassword")
# print(buffer.getvalue().decode("iso-8859-1"))

Gives output:

| * Trying
| * Connected to ( port 443 (#0)
| * ALPN, offering http/1.1
| * SSL certificate problem: unable to get local issuer certificate
| * Closing connection 0
| Traceback (most recent call last):
| File "C:/Users/User/.PyCharmCE2017.3/config/scratches/",
line 12, in <module>
| curl.perform()
| pycurl.error: (60, 'SSL certificate problem: unable to get local
issuer certificate')

curl command that does work:

curl -verbose --user
"somename:[REDACTED]" --request GET

Output: Gives a note that the request parameter is superficial. Also
logs a lot of things and gives a good result and the expected JSON
string as data. Has no problem establishing a SSL/TLS connection.

PROBLEM: pycurl doesn't seem to be able to establish a connection.
Judging by curl working, curllib isn't the problem and neither is the

As noted on the pycurl docs, I tried it both with python version and
with the curl version, and got different results indeed. The only
assumption I have left is that it might have something to do with
pycurl reading the user variable different - but there's no single
"user" flag that pycurl knows about, and there's nothing that it says
about this or any other case like it.

The request I did was in a getting started guide here:

It gives the example only for normal curl, in the following way:

| curl --request GET \
| --url 'https://<dc>' \
| --user 'anystring:<your_apikey>'

the command line curl version working means that I don't think this
issue is due to curl or the server i'm talking to, and honestly im at
a loss where the issue can be in this case, probably because this is
my first time dealing with HTTP requests or internet communication on
this level.

-- Jacco van Dorp
Received on 2018-01-09