Why am I getting “Connection reset by peer” with I

2020-03-30 04:22发布

I am trying to use Indy HTTP (Delphi Seattle) to get the contents of a https webpage and I always seem to get Error 10054 - Connection reset by peer. Other sites seem to work just fine. The website in cause is https://www.adultwork.com. I have added the SSL, Cookie and Compressor components, but maybe I'm missing something, some settings, IDK... If anybody could help, it would be greatly appreciated.

2条回答
Root(大扎)
2楼-- · 2020-03-30 04:27

Thanks both for pointing in the right direction! Seems like besides the TLS 1.2 part, I was also using outdated dlls. Using updated dlls and the TLS 1.2 version made things work.

查看更多
小情绪 Triste *
3楼-- · 2020-03-30 04:30

I was able to reproduce the issue, and it is due to Indy's TIdIOHandlerSocketOpenSSL component only enabling TLS v1.0 by default.

Like many other sites nowadays, AdultWorks does not accept TLS 1.0 anymore. In fact, it doesn't accept TLS 1.1, either. It requires TLS 1.2. Once I enabled TLS 1.2 in the IOHandler's SSLVersions property, TIdHTTP.Get() was able to access the site without error.

查看更多
登录 后发表回答