Have a different Indy version? The principles here apply to Indy 8, 9, and early 10 with appropriate adjustments. For Delphi versions after 2010, consider migrating to TNetHTTPClient for native TLS support.
function GetViaWinHTTP(const URL: string): string; var hSession, hConnect, hRequest: HINTERNET; Buffer: array[0..4095] of Char; BytesRead: DWORD; ResultStr: string; begin hSession := WinHttpOpen('Delphi7App/1.0', WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, nil, nil, 0); hConnect := WinHttpConnect(hSession, PChar('api.example.com'), INTERNET_DEFAULT_HTTPS_PORT, 0); hRequest := WinHttpOpenRequest(hConnect, 'GET', PChar('/data'), nil, nil, nil, WINHTTP_FLAG_SECURE); WinHttpSendRequest(hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0, nil, 0, 0, 0); WinHttpReceiveResponse(hRequest, nil); ResultStr := ''; while WinHttpReadData(hRequest, @Buffer, SizeOf(Buffer), BytesRead) do if BytesRead > 0 then ResultStr := ResultStr + Copy(Buffer, 1, BytesRead) else Break; WinHttpCloseHandle(hRequest); WinHttpCloseHandle(hConnect); WinHttpCloseHandle(hSession); Result := ResultStr; end; Delphi 7 Indy 9 Could Not Load Ssl Library
: OpenSSL 0.9.6 and TLS 1.0 are considered insecure and are deprecated. Delphi 7 Indy 9 Could Not Load Ssl Library - Google Groups Have a different Indy version
uses IdHTTP, IdSSL, IdSSLOpenSSL;