0

I am new to Python and I'm trying to get the data from Nasa API by using this code.

import requests
data = requests.get('https://data.nasa.gov/resource/gh4g-9sfh.json')

Then it fails with the following error

SSLError:  HTTPSConnectionPool(host='data.nasa.gov', port=443): Max retries exceeded with url: /resource/gh4g-9sfh.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1122)')))

I think it was looking for some SSL Certificate which I have no idea how to get. Since anyway it was for practising and nothing important I used the verification to False but that gives some other error.

data = requests.get('https://data.nasa.gov/resource/gh4g-9sfh.json',verify='False')

Which gives me the following error:

OSError: Could not find a suitable TLS CA certificate bundle, invalid path: False

Although the error message has changed, looks like it's still expecting some sort of certificate.

What can I do to solve my problem?

Shunya
  • 2,344
  • 4
  • 16
  • 28
Cody
  • 21
  • 3
  • Does this answer your question? [Python Requests throwing SSLError](https://stackoverflow.com/questions/10667960/python-requests-throwing-sslerror) – ForceBru Jan 16 '21 at 12:55
  • Note that in `verify='False'`, `'False'` is a _string_. – ForceBru Jan 16 '21 at 12:55

0 Answers0