-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Failed SSL handshake #7429
Comments
What version of Requests are you using (helps to match line numbers)? There are a few possibilities, one may be that the website uses an unsupported cipher. Another thing to do is add some exception printing statements within the Requests library, particularly in the |
Thanks @anecdata; here is the output of curl:
No idea how to interpret the results, the actions curl takes looks similar to what the lib does inside. |
I have found, that adafruit_requests is frozen, so I have replaced it with my version. I have added prints at certain moments of the file (as I don't know how to debug life on the MagTag), I wanted to check, what is actually going on. Anyone? |
The 301 redirect shouldn't be a problem, but you could try putting the final location URL in as your initial URL in Requests (looks like only a difference of a trailing slash). Here's what I have in that section of Requests for debugging. It's likely to be an try:
sock.connect((connect_host, port))
print(f"#### DEBUG sock.connect success")
except MemoryError as e:
traceback.print_exception(e, e, e.__traceback__)
sock.close()
sock = None
except OSError as e:
traceback.print_exception(e, e, e.__traceback__)
sock.close()
sock = None |
@anecdata thanks for help here, get to the following error now :): I think that the certificate is not trusted and thou such reaction. W. |
Seems like a cipher or certificate issue, or something at that level, but I'm not sure at this point. There's a similar issue here. There are ways to supply a certificate, but I don't think that's helpful here. I can't connect to context = ssl.create_default_context()
context.check_hostname = False
session = adafruit_requests.Session(pool, context) If you want to try supplying a certificate, here's some code: If it's an unsupported cipher, espressif (or the website) has to make a change. |
@anecdata I have taken the certificate from the page, and added as in your example - same results. W. |
Using |
OK, found the problem. So steps to solve:
Thank you all for help. |
CircuitPython version
Code/REPL
Behavior
code.py wyjście:
my IP addr: 192.168.2.156
Ślad wyjątku (najnowsze wywołanie na końcu):
Plik "code.py", linia 12, w
Plik "adafruit_requests.py", linia 725, w get
Plik "adafruit_requests.py", linia 666, w request
Plik "adafruit_requests.py", linia 518, w _get_socket
RuntimeError: Sending request failed
blinking RED
Description
Hi,
error while calling Warsaw IOT data service.
https://api.um.warszawa.pl/api/action/dbtimetable_get?id=88cd555f-6f31-43ca-9de4-66c479ad5942&busstopId=4125&busstopNr=02&apikey=apikeygoeshere"
It works on other REST calls, but not on Circuit Python using or this program or build-in MagTag API refresh.
No idea how to proceed and what to check more, as my Python is limited.
I can give full URL in private message, here I have removed API key.
Additional information
No response
The text was updated successfully, but these errors were encountered: