8000 SSL error connecting to aeroapi.flightaware.com · Issue #8925 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

SSL error connecting to aeroapi.flightaware.com #8925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
justmobilize opened this issue Feb 15, 2024 · 6 comments · Fixed by #8935
Closed

SSL error connecting to aeroapi.flightaware.com #8925

justmobilize opened this issue Feb 15, 2024 · 6 comments · Fixed by #8935
Assignees
Milestone

Comments

@justmobilize
Copy link

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0-33-g264e68fe16 on 2024-02-15; FeatherS3 with ESP32S3
from `Merge pull request #8924 from dhalbert/tls-nist-optim`

Code/REPL

import os
import socketpool
import ssl
import wifi
import adafruit_requests

wifi_ssid = os.getenv("CIRCUITPY_WIFI_SSID")
wifi_password = os.getenv("CIRCUITPY_WIFI_PASSWORD")

while not wifi.radio.connected:
    wifi.radio.connect(wifi_ssid, wifi_password)

requests = adafruit_requests.Session(socketpool.SocketPool(wifi.radio), ssl.create_default_context())
response = requests.get("https://aeroapi.flightaware.com/aeroapi/flights/search")
print(response.text)

Behavior

In CircuitPython

Traceback (most recent call last):
  File "adafruit_requests.py", line 515, in _get_socket
OSError: Failed SSL handshake

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 16, in <module>
  File "adafruit_requests_2.py", line 752, in get
  File "adafruit_requests_2.py", line 691, in request
  File "adafruit_requests_2.py", line 496, in _get_socket
RuntimeError: Sending request failed

in CPython:

In [1]: import requests

In [2]: response  = requests.get("https://aeroapi.flightaware.com/aeroapi/flights/search").text

In [3]: print(response.text)

        {"title": "Invalid API key", "reason": "INVALID_API_KEY", "detail": "Provided API key is not valid", "status": 401}

Description

No response

Additional information

No response

@tannewt
Copy link
Member
tannewt commented Feb 16, 2024

Does it work with 8.x?

@tannewt tannewt added this to the 9.0.0 milestone Feb 16, 2024
@dhalbert
Copy link
Collaborator

This appears to be a missing root cert: SSL.com Root Certification Authority RSA. I'll add it to certificates and re-test.

@dhalbert dhalbert self-assigned this Feb 16, 2024
@justmobilize
Copy link
Author

It does not. Tested on a M4+Airlift, Pico W and UM FeatherS3

@justmobilize
Copy link
Author

@dhalbert feel free to ping me here or discord if you want me to test

@dhalbert
Copy link
Collaborator

@justmobilize I tested with your test program with the new cert, and now get:

        {"title": "Invalid API key", "reason": "INVALID_API_KEY", "detail": "Provided API key is not valid", "status": 401}

which is what I expect. PR on the way.

@justmobilize
Copy link
Author

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0