U
U
user.2021-08-15 17:36:08
Python
user., 2021-08-15 17:36:08

Error with certificates when doing a get request?

Good afternoon,
tell me how it is possible to fix this error when making a GET request to api.

#!/usr/bin/env python3

import urllib
from urllib.request import urlopen

html = urlopen("https://some_api/")
contents = html.read()


error text:

html = urlopen(" https://mabbox.bytel.fr/api/v1/lan/ip ")
File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener. open(url, data, timeout)
File "/usr/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/lib/python3. 8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 1393, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/usr/lib/python3.8/urllib/request.py", line 1353, in do_open
raise URLError(err)
urllib.error.URLError:

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question