Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
#2
(09-16-2020, 04:11 PM)ronaldobim Wrote: I am unable to consume a third party API that is hosted on Amazon, I tried several OpenSSL DLLs but without success.

Which DLLs exactly did you try?  What does Indy's IdSSLOpenSSL.OpenSSLVersion() function report when the error occurs?

(09-16-2020, 04:11 PM)ronaldobim Wrote: I am attaching a small test project with the error example.

You are not configuring the TIdSSLIOHandlerSocketOpenSSL at all.  In particular, it defaults to TLS 1.0 only, but most servers nowadays require TLS 1.1+, so try setting its SSLOptions.SSLVersions property accordingly, eg:

Code:
FHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
FIdHTTP.SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2]; // <-- ADD THIS!
...

Also, you are leaking the TIdSSLIOHandlerSocketOpenSSL object, as you are not Free()'ing it, or assigning an Owner to it.  Assigning the TIdHTTP.IOHandler property will not take ownership for you.  I suggest assigning the TIdHTTP object as the Owner, eg:

Code:
FIdHTTP := TIdHTTP.Create(nil); // <-- DO THIS FIRST!
FHandler := TIdSSLIOHandlerSocketOpenSSL.Create(FIdHTTP);

Also, on a side note, you don't need the TStringStream at all, as TIdHTTP.Get() has an overload that returns a String, eg:

Code:
Memo1.Text := FIdHTTP.Get('https://james-assortment-orders-stg.james.delivery/orders/consume-pre-orders/0583266930008a57838f5141aae0ea5138ec43aebd5465465');

Reply


Messages In This Thread
RE: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure - by rlebeau - 09-16-2020, 10:34 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)