![]() |
Delphi8 problem accessing https: web data - SSL - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Indy (https://www.atozed.com/forums/forum-8.html) +--- Forum: Indy General Discussion (https://www.atozed.com/forums/forum-9.html) +--- Thread: Delphi8 problem accessing https: web data - SSL (/thread-1527.html) |
Delphi8 problem accessing https: web data - SSL - rmwatson3rd@gmail.com - 02-06-2020 I have downloaded the appropriate DLLs and have them in the right place ... etc etc ... least I think I do. I can access an http site (without the s) ... But I get an error with https sites ... (with the s) Specifically the error says "could not load SSL library" . Any suggestions, directions, etc are appreciated. Thank you, Bob W RE: Delphi8 problem accessing https: web data - SSL - Jose Nilton Pace - 02-06-2020 OpenSSL dll's are version 1.0.2.u ?. RE: Delphi8 problem accessing https: web data - SSL - rlebeau - 02-07-2020 (02-06-2020, 06:16 PM)rmwatson3rd@gmail.com Wrote: I have downloaded the appropriate DLLs and have them in the right place ... etc etc ... least I think I do. It would help to know WHICH ones you downloaded, WHERE you placed them ... etc etc ... (02-06-2020, 06:16 PM)rmwatson3rd@gmail.com Wrote: I can access an http site (without the s) ... Sure, since it doesn't use SSL/TLS, and Indy doesn't load OpenSSL until it is actually needed. (02-06-2020, 06:16 PM)rmwatson3rd@gmail.com Wrote: But I get an error with https sites ... (with the s) You can use Indy's WhichFailedToLoad() function in the IdSSLOpenSSLHeaders unit to find out why. Either the DLLs themselves could not be loaded into memory (ie, using 32bit DLLs in a 64bit project or vice versa, or mixing different versions of the DLLs together), or the DLLs are missing required function exports that Indy uses. RE: Delphi8 problem accessing https: web data - SSL - rmwatson3rd@gmail.com - 02-07-2020 (02-07-2020, 01:19 AM)rlebeau Wrote: It would help to know WHICH ones you downloaded, WHERE you placed them ... etc etc ... I downloaded them from this site https://indy.fulgan.com/SSL/ I put them in a directory C:\Programs\XE8\SSL_DLL_ForScraping I have the Project -> Options -> Search Path going thru this directory On FormCreate I added this code: Code: procedure TForm1.FormCreate(Sender: TObject); (02-07-2020, 01:19 AM)rlebeau Wrote: Sure, since it doesn't use SSL/TLS, and Indy doesn't load OpenSSL until it is actually needed. Response - OK, thanks (02-07-2020, 01:19 AM)rlebeau Wrote: You can use Indy's WhichFailedToLoad() function in the IdSSLOpenSSLHeaders unit to find out why. Either the DLLs themselves could not be loaded into memory (ie, using 32bit DLLs in a 64bit project or vice versa, or mixing different versions of the DLLs together), or the DLLs are missing required function exports that Indy uses. This is the code: Code: function GetPage(aURL: string): string; RE: Delphi8 problem accessing https: web data - SSL - Jose Nilton Pace - 02-07-2020 Hi Bob, to consume HTTPS you need: Code: IdHTTP.IOHandler := IdSSLIOHandlerSocketOpenSSL; RE: Delphi8 problem accessing https: web data - SSL - rlebeau - 02-08-2020 (02-07-2020, 03:41 AM)rmwatson3rd@gmail.com Wrote: I downloaded them from this site https://indy.fulgan.com/SSL/ But WHICH ZIP FILE EXACTLY did you download? (02-07-2020, 03:41 AM)rmwatson3rd@gmail.com Wrote: I put them in a directory C:\Programs\XE8\SSL_DLL_ForScraping That is not necessary. That option has no effect on your app at runtime, and the DLLs are not used at compile-time. (02-07-2020, 03:41 AM)rmwatson3rd@gmail.com Wrote: On FormCreate I added this code: That code is OK. (02-07-2020, 03:41 AM)rmwatson3rd@gmail.com Wrote: This is the code: Putting the call to WhichFailedToLoad() right after the call to TIdHTTP.Get() doesn't work because the error is reported as a raised exception. So you need a try..except block to catch that exception, eg: Code: function GetPage(aURL: string): string; (02-07-2020, 01:26 PM)Jose Nilton Pace Wrote: Hi Bob, to consume HTTPS you need: FYI, TIdHTTP handles that automatically by default. You don't need to assign an SSLIOHandler explicitly, unless you need to customize the SSLIOHandler (specify certificates, enable TLS 1.1/1.2, etc). Bob would not be getting a "could not load SSL library" error if TIdSSLIOHandlerSocketOpenSSL were not being assigned to TIdHTTP. He would be getting an "IOHandler value is not valid" error instead. |