Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

sslv3 alert handshake failure

OK, So I've been working on a Discord Bot for the past couple of weeks interacting with some 3rd party API's, I was going
over my code yesterday when I started to get an error getting access to a particular website.

I've included a link to pastebin where I've posted the error message which is basically a sslv3 alert handshake failure, I working with the latest 3.9 version of python so I don't think this would be an update issue

Paste_Bin_Link
[Image: Web-Logo-copy.gif]
Following the stack trace, the Discord Python module calls into OpenSSL's "SSL_do_handshake" method via CPython which is what raises your exception. You can see the documentation for this method here: https://www.openssl.org/docs/man1.1.1/ma...shake.html.

Looking at the error cases from that documentation: "The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur if action is needed to continue the operation for nonblocking BIOs. Call SSL_get_error() with the return value ret to find out the reason."

Double check your parameters according to this information:
  • Are you connecting to a valid and alive host? Verify the status of this. (some-random-api.ml looks like the target host)

  • Check your system policies to ensure nothing is blocking the connection.

  • Have you properly directed the API to use the correct SSL/TLS certificates? In the event of a protocol failure, it usually means that the cryptographic item is corrupted (i.e. public certificate/certificate chain is invalid). Try to download the latest copies/reissue if applicable and look for other examples on how to use the Discord API to ensure you are applying the certificates correctly.

  • Still not working? Try to connect to your host via OpenSSL and debug the library as it performs the handshake to narrow down exactly where the error is happening within the protocol (this probably isn't needed - just double check the certs).


(Oct 10, 2021 05:18 AM)Donkey Death Jam Wrote:  
  • Are you connecting to a valid and alive host? Verify the status of this. (some-random-api.ml looks like the target host)

  • Check your system policies to ensure nothing is blocking the connection.

  • Have you properly directed the API to use the correct SSL/TLS certificates? In the event of a protocol failure, it usually means that the cryptographic item is corrupted (i.e. public certificate/certificate chain is invalid). Try to download the latest copies/reissue if applicable and look for other examples on how to use the Discord API to ensure you are applying the certificates correctly.

  • Still not working? Try to connect to your host via OpenSSL and debug the library as it performs the handshake to narrow down exactly where the error is happening within the protocol (this probably isn't needed - just double check the certs).



Thanks for your reply, first point yes I’m connected to a valid and live host because I was interacting with other parts of the same API, I’m getting the handshake failure error when I try to scrape multiple images

I’ll go through the other stuff you’ve mentioned and read those docs you linked
[Image: Web-Logo-copy.gif]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by v.e.n.o.mApr 25, 2018 06:16 AM 3 175 Apr 25, 2018 06:16 AM
Last Post: Dalvik
[C] by Byte™Aug 8, 2017 12:35 AM 2 260 Aug 8, 2017 12:35 AM
Last Post: owonbo
[C] by Byte™Sep 7, 2016 07:20 PM 4 292 Sep 7, 2016 07:20 PM
Last Post: excr4sh