为什么我会收到“对等连接重置”消息?仅在HTTPS(SSL)网站上使用Indy? [英] Why am I getting "Connection reset by peer" with Indy only on a HTTPS (SSL) site?

查看:96
本文介绍了为什么我会收到“对等连接重置”消息?仅在HTTPS(SSL)网站上使用Indy?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Indy HTTP(Delphi Seattle)来获取https网页的内容,而且我似乎总是会收到错误10054-由对等方重置连接。其他站点似乎工作正常。原因是该网站为 https://www.adultwork.com 。我已经添加了SSL,Cookie和Compressor组件,但也许我缺少一些东西,一些设置,IDK ...如果有人可以帮助,将不胜感激。

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.

推荐答案

我能够重现该问题,这是由于Indy的 TIdIOHandlerSocketOpenSSL 组件仅默认情况下启用TLS v1.0

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

与其他许多网站一样如今,AdultWorks不再接受TLS 1.0。实际上,它也不接受TLS 1.1。它需要TLS 1.2。一旦我在IOHandler的 SSLVersions 属性中启用了TLS 1.2, TIdHTTP.Get()就可以访问该站点而不会出现错误

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.

这篇关于为什么我会收到“对等连接重置”消息?仅在HTTPS(SSL)网站上使用Indy?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆