I understand the problem was discussed lot of times. I have made lot of projects with Indy and http/https.
In actual project second side gave me api endpoint secured with ssl.
I think I can publish it with demo credentials.
https://portal.myraindancer.com/api/v1/crops?client=150002&username=demo&password=demo
After 2 hours I have to give up and I suspect the problem is at the api side.
I always get exception with
#10054: Connection reset by peer.
Could you help me to show correct way to get data?
I use browser with the URL and can get data without any problem.
Code snippet (pls note I used all possible ssl methods):
procedure TForm2.Button1Click(Sender: TObject);
var
sHttpSocket: TIdHTTP;
sshSocketHandler: TIdSSLIOHandlerSocketOpenSSL;
begin
sHttpSocket := TIdHTTP.Create;
try
sshSocketHandler := TIdSSLIOHandlerSocketOpenSSL.Create(sHttpSocket);
sshSocketHandler.SSLOptions.Method := sslvSSLv23;
sHttpSocket.IOHandler := sshSocketHandler;
sHttpSocket.Get('https://portal.myraindancer.com/api/v1/crops?client=150002&username=demo&password=demo');
finally
sHttpSocket.Free;
end;
end;
UPDATE: Delphi XE7, Win32 project, Indy 10.6.2.0
UPDATE 2: The problem occured after I updatd Indy to last version. But I forgot to correct library path in project options. Solved. I think it would be better to close the post.