nationalparkservice / nps-api-samples

Sample Code using calls to the NPS API
32 stars 9 forks source link

Is there a problem with the SSL certificate? #4

Closed edwarddperkins closed 1 year ago

edwarddperkins commented 1 year ago

I'm just starting to experiment with the API, but I am getting an error stating that the certificate has expired.

<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:992)>

I am using sample code in Python, and I also have replaced the Authorization with X-Api-Key. I was able to get a response finally that way, but the cert error is stopping me. I am not an expert level programmer, but I do know enough Python and PHP to get data back in my API calls.

Thank you for all the work you have done on this and the continued support I've seen recently!

edwarddperkins commented 1 year ago

Just a little more info. When I authorize the same API key that produces the error in my Python code at https://www.nps.gov/subjects/developer/api-documentation.htm#/ I am able to return results. Thanks again for your help and support on this awesome API!

edwarddperkins commented 1 year ago

My mistake, I wasn't passing the headers correctly, after inspecting the response from the endpoint more closely in the documentation, I was able to adjust my code and return data. I think we can close this ticket. Ultimately, I think the difference was using the CURL equivalent in Python using the Requests library.