linux - 对等错误重置 HTTPs 握手连接
问题描述
在对我的服务器执行简单的 Https 请求时,我遇到了此 Connection Reset By Peer Error。
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer
提供大纲:
- 涉及三个网络:EC2 服务器、远程 VPN 掩码服务器、家庭网络
- EC2 Server 是网站主机,Remote VPN Masked Server 是另一个远程主机,Home Network 是普通网络。
- 在 EC2 上设置了一个服务器,入站接受所有 80 和 443 端口。主要是 HTTPs,HTTP 被重定向到 443。
- 当使用 VPN 然后 ssh 进入远程服务器,然后尝试从该服务器发送一个简单的 https 请求到 EC2 服务器时,会发生上述错误。
调查内容:
- 我最初以为是 EC2 入站设置,打开所有端口似乎没有帮助
- 我跟踪了 EC2 服务器上的传入数据包,并且能够看到请求的数据包进出使用:
sudo tcpdump -ni any port 443
(抱歉这里不能提供日志,但是我看到了 seq 和 ack 交换)
- 但是在远程服务器端没有收到任何东西:
Starting new HTTPS connection (1): my-website.com:443
Starting new HTTPS connection (1): my-website.com:443
Starting new HTTPS connection (1): my-website.com:443
Starting new HTTPS connection (1): my-website.com:443
Starting new HTTPS connection (1): my-website.com:443
- 从我的家庭网络尝试时,它运行良好:
Starting new HTTPS connection (1): my-website.com:443
https://www.my-website.com:443 "POST /api/v1/auth/login HTTP/1.1" 200 50
Starting new HTTPS connection (1): my-website.com:443
https://www.my-website.com:443 "POST /api/v1/auth/login HTTP/1.1" 200 50
Starting new HTTPS connection (1): my-website.com:443
https://www.my-website.com:443 "POST /api/v1/auth/login HTTP/1.1" 200 50
Starting new HTTPS connection (1): my-website.com:443
https://www.my-website.com:443 "POST /api/v1/auth/login HTTP/1.1" 200 50
Starting new HTTPS connection (1): my-website.com:443
https://www.my-website.com:443 "POST /api/v1/auth/login HTTP/1.1" 200 50
(注意假网站是用来覆盖真实网站的)
我怀疑是远程 VPN 屏蔽服务器上的 VPN/防火墙设置导致了问题,否则为什么它可以通过我的家庭网络工作。但我不知道我能做些什么来确定或解决这个问题。
任何指导表示赞赏。谢谢!
解决方案
推荐阅读
- python-3.x - 请求响应python中缺少html
- javascript - d3v4气泡图更新
- google-analytics - 我们可以跟踪每个受众在网页上的行为持续时间吗?
- windows - cygwin git项目下创建的windows文件夹和文件不可访问
- c - 通过交换节点选择单链表(迭代方法)?
- php - 如何在 Codeigniter 4 模型中放置条件
- tensorflow - 如何使用 HParams Dashboard 调整学习率
- java - Firebase 数据快照返回空值
- node.js - 运行 Electron 应用程序导致 ELIFECYCLE 错误
- azure - 无法将 Azure AD 管理员用户添加到 Enterprise Admins 组