I'm trying to connecto to this url, just using a get request. Goberment page But always get the error EIdOSSLConnectError "Error connecting with SSL"
The code I use, is this, it works with other pages, but not this one
IdHTTP1.HandleRedirects := true;
IdHTTP1.AllowCookies := true;
IdHTTP1.IOHandler := TIdSSLIOHandlerSocket.Create(IdHTTP1);
IdHTTP1.CookieManager := TIdCookieManager.Create(IdHTTP1);
with TIdSSLIOHandlerSocket(IdHTTP1.IOHandler) do begin
SSLOptions.Method := sslvTLSv1;
SSLOptions.Mode := sslmUnassigned;
SSLOptions.VerifyMode := [];
SSLOptions.VerifyDepth := 0;
PassThrough := True;
end;
IdHttp1.Request.UserAgent := 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0';
IdHTTP1.RedirectMaximum := 30;
sHtml := IdHTTP1.Get('https://loginc.mat.sat.gob.mx/nidp/app/login?id=XACCertiSAT&sid=0&option=credential&sid=0');//<----Error here
Delphi 7, Indy 9.00.10
Thanks for any advice
RedirectMaximum
value seems to expect redirects almost across the whole Universe (42 is the maximum the Universe accepts :)SSLOptions.Method := sslvTLSv1;
changed toSSLOptions.Method := sslvSSLv23;
and also using the openssl dll openssl-1.0.2-i386-win32.zip, openssl-1.0.2-x64_86-win64.zip didn't work. Victoria, I use 30 redirects, because, I did not know how many times would do it :p. Off topic, Remy, have you installed reportmanager 2_7 with indy 10? thanks guysSSLOptions.Method
property directly (it is deprecated, so pretend it doesn't exist), use theSSLOptions.SSLVersions
property instead. If you enable multiple versions (like[sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]
), theMethod
will be set tosslvSSLv23
for you (but that is an implementation detail). SettingMethod
tosslvSSLv23
is the same as settingSSLVersions
to[sslvSSLv2,sslvSSLv3,sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]
.