indy

How to download a file over HTTPS using Indy 10 and OpenSSL?

流过昼夜 提交于 2019-11-30 00:51:26
I have the following task: download a file using HTTPS and authentication. Indy seems the way to go but for some reason it doesn't work so far. I have the following in place: a TIdHTTP component which I use for downloading a TIdURI component used to create the URL a TIdSSLIOHandlerSocketOpenSSL component which should provide the secure connection. The required DLLs are in the binary folder. The site also requires authentication and I included the user/pass in the URL as in the example below. In short this is the code: URI := TIdURI.Create('https://test.example.com/'); URI.Username :=

EIdOSSLUnderlyingCryptoError Exception

穿精又带淫゛_ 提交于 2019-11-29 22:59:34
问题 I am using Indy (IdHTTP, OpenSSL). I use this simple code to download a page var IdHTTP: TIdHTTP; begin IdHTTP:=TIdHTTP.Create; try IdHTTP.Get('https://ezfile.ch/?m=help&a=tos'); finally IdHTTP.Free; end; end; It returns: EIdOSSLUnderlyingCryptoError exception "Error connecting with SSL. error:14094438:SSL routines:SSL3_READ_BYTES:tlsv1 alert internal error" The site uses TLS 1.1, AES_128_CBC_SHA1, ECDHE-ECDSA. It should be easily reproducible. Tried with various Delphi versions, Indy 10.6.2,

Use Indy to perform an IPv6 reverse DNS lookup

半城伤御伤魂 提交于 2019-11-29 22:07:26
问题 I am using Indy to perform a reverse IPv4 lookup using the following code. function ReverseDNSLookup(const IPAddress: String; const DNSServer: String; Timeout, Retries: Integer; var HostName: String): Boolean; var AIdDNSResolver: TIdDNSResolver; RetryCount: Integer; begin Result := FALSE; AIdDNSResolver := TIdDNSResolver.Create(nil); try AIdDNSResolver.QueryResult.Clear; AIdDNSResolver.WaitingTime := Timeout; AIdDNSResolver.QueryType := [qtPTR]; AIdDNSResolver.Host := DNSServer; RetryCount :=

Delphi HTTP Post JSON

穿精又带淫゛_ 提交于 2019-11-29 18:12:40
问题 I am sure I'm doing something wrong here. I've followed every example I can find on stackoverflow and still haven't gotten this to work in my environment. I'd love to update my controls and environment, but I'm currently locked in with what I have. I am using: Delphi 7 Indy 10.0.52 ulkJSON.pas v1.07 I need to send this JSON to a URL: "auth": { "applicationId": "appID", "applicationPassword": "pwd", "accountId": "acct", "userId": "dev" } There isn't anything terribly crazy about this, but when

Is there a way to set response timeout for Indy Tidhttp gets?

不羁的心 提交于 2019-11-29 18:03:52
问题 I have built a simple website monitoring application using Indy TIdhttp component. I want to detect when a designated page is not returned within a specified time frame (I am using 5000 milliseconds). As a test I created a page on a web site which intentionally takes 15 seconds to respond. But I can't get my procedure to "give up" after the 5 seconds. I have tried ReadTimeout , a suggested solution using a timer and the OnWorkBegin event (was never able to get OnWorkBegin to fire immediately

How can I get Delphi XE2 to talk to Google Calendar APIs over SSL?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 17:18:38
问题 It's time for this question again, but this time with Delphi XE2. I am using the Indy version 10.5.8.0 that ships with XE2, and I have tried four different versions of the SSL dlls. I have tried 1.0.x latest, and about 3 different 0.9.8 versions (e,h,x,....). None of them works, when communicating to https:// urls at calendar.google.com. The author of the Delphi Google Calendar component at "Sync-components.com" ships his own binary openssl DLL runtimes that have no version information in it,

Stopping Delphi Indy threads without having to wait end Timeout

梦想的初衷 提交于 2019-11-29 15:34:12
问题 It's the first time I work on a multi-threads application with Delphi so all is still fesh for me, but I read a lot. My thread is simple, to be short I just use Indy (IdHTTP) to GET the content of a web page and then I verify if the content contains a string. No problems here. Now, to terminate threads I use a boolean with WHILE DO. It seems working but here is the problem : like I use a Timeout with Indy, sometimes I must wait the end of the timeout period before threads finish (when the

IdHttp Just Get Response Code

点点圈 提交于 2019-11-29 13:16:40
问题 I'm using idhttp (Indy) to do some website checking. All I want it to do is check the response code from the server after my request has been sent, I don't want to actually have to receive the HTML output from the server as I'm only monitoring for a 200 OK code, any other code meaning there is an issue of some form. I've looked up idhttp help documents and the only way I could see to possible do this would be to assign the code to a MemoryStream and then just clear it straight away, however

Delphi Pos always returning 0

假装没事ソ 提交于 2019-11-29 12:40:10
I really don't know why Pos keep returning 0 instead of the char ";" position in string I have to get a response of a php page which outputs a Content-Type: text/plain So one example output is 2;fulano;fulano;0 3;ciclano;ciclano;0 4;beltrano;beltrano;0 5;foo;foo;0 8;jose;jose;0 9;maria;maria;0 and the code is var linha,uid,login,senha,email,tipo : WideString; resposta : TStringList; I : Integer; begin try resposta := TStringList.Create; resposta.Text := frmMain.IdHTTP1.Get(frmMain.cdsConfig.FieldByName('WebService').AsString+'listdest.php'); for I := 0 to resposta.Count-1 do begin linha :=

Evaluate Email with Indy 10 and DELPHI

↘锁芯ラ 提交于 2019-11-29 11:38:29
I use the following code to eval the msg. content (body / lines) of an E Mail msg received with the INDY 10 components function LinesFromMsg(aMsg: TIdMessage): TStrings; var i: Integer; begin for i := 0 to aMsg.MessageParts.AttachmentCount-1 do begin if (amsg.MessageParts.Items[i].ContentType ='HTML') then begin if (amsg.MessageParts.Items[i] is Tidtext) then Result := TidText(amsg.MessageParts.Items[i]).body; end; end; end; regarding this code I have 2 questions : a) is this the correct way of finding the Tlines part in an arbitray mail message ? ( consider the advice shown at INDY 10 EMAIL