与 ssl 连接时出错。观察到违反协议的Eof
Error connecting with ssl. Eof was observed that violates the protocol
我想从站点 https://exergy.skmenergy.com
获取数据。我使用 TIdHttp。
我的设置
FHttp := TIdHTTP.Create(nil);
FSSLIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
FSSLIOHandler.MaxLineAction := maException;
FSSLIOHandler.SSLOptions.Method := sslvSSLv23;
FSSLIOHandler.SSLOptions.Mode := sslmUnassigned;
FSSLIOHandler.SSLOptions.SSLVersions := [sslvSSLv2, sslvSSLv3, sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];
FCookie := TIdCookieManager.Create(nil);
with FHttp do
begin
IOHandler := FSSLIOHandler;
CookieManager := FCookie;
AllowCookies := True;
HandleRedirects := True;
Request.BasicAuthentication := True;
if StrToBoolDef(FParam.Items['ProxyUse'], True) = True then
begin
ProxyParams.ProxyPort := StrToInt(FParam.Items['Port']);
ProxyParams.ProxyServer := FParam.Items['Server'];
ProxyParams.ProxyUsername := FParam.Items['Login'];
ProxyParams.ProxyPassword := FParam.Items['ProxyPassword'];
end;
ReadTimeout := 100000000;
end;
但是在我从线程调用的代码中
FHTTP.Get('https://exergy.skmenergy.com);
我收到一个错误
Error connecting with ssl. eof was observed that violates the protocol delphi
。
UPD
文件 libeay32.dll
和 ssleay32.dll
包含在项目中。 Version 1.1.0.1
我使用 Embarcadero® RAD Studio 10.2 Version 25.0.29039.2004
Indy 不支持OpenSSL 1.1.xx.
需要使用OpenSSL 1.0.2版本https://github.com/IndySockets/OpenSSL-Binaries
我想从站点 https://exergy.skmenergy.com
获取数据。我使用 TIdHttp。
我的设置
FHttp := TIdHTTP.Create(nil);
FSSLIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
FSSLIOHandler.MaxLineAction := maException;
FSSLIOHandler.SSLOptions.Method := sslvSSLv23;
FSSLIOHandler.SSLOptions.Mode := sslmUnassigned;
FSSLIOHandler.SSLOptions.SSLVersions := [sslvSSLv2, sslvSSLv3, sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];
FCookie := TIdCookieManager.Create(nil);
with FHttp do
begin
IOHandler := FSSLIOHandler;
CookieManager := FCookie;
AllowCookies := True;
HandleRedirects := True;
Request.BasicAuthentication := True;
if StrToBoolDef(FParam.Items['ProxyUse'], True) = True then
begin
ProxyParams.ProxyPort := StrToInt(FParam.Items['Port']);
ProxyParams.ProxyServer := FParam.Items['Server'];
ProxyParams.ProxyUsername := FParam.Items['Login'];
ProxyParams.ProxyPassword := FParam.Items['ProxyPassword'];
end;
ReadTimeout := 100000000;
end;
但是在我从线程调用的代码中
FHTTP.Get('https://exergy.skmenergy.com);
我收到一个错误
Error connecting with ssl. eof was observed that violates the protocol delphi
。
UPD
文件 libeay32.dll
和 ssleay32.dll
包含在项目中。 Version 1.1.0.1
我使用 Embarcadero® RAD Studio 10.2 Version 25.0.29039.2004
Indy 不支持OpenSSL 1.1.xx.
需要使用OpenSSL 1.0.2版本https://github.com/IndySockets/OpenSSL-Binaries