ssl - 使用 SSL 的雅司给出错误 "SSL accept failed: timeout"

标签 ssl timeout yaws certbot

我使用 certbot 为我的网站生成一个 Let's encrypt 证书,但是当我尝试连接到它时(当然是在它超时之后),Yaws 给我一个 SSL accept failed: timeout 错误。有趣的是,当我将 example.com 重定向到我机器上主机文件中服务器的本地 ip 地址并连接到 example.com:8080 时,它会起作用,但是当我连接到 example.com 而没有编辑主机文件,或者当我通过 4G 从手机连接时。这是我的网络服务器的配置文件(它是 conf.d 中唯一的配置文件):

<server www.example.com>
    port = 8080
    listen = 0.0.0.0
    docroot = /usr/share/yaws
    <ssl>
        keyfile = /etc/letsencrypt/live/example.com/privkey.pem
        certfile = /etc/letsencrypt/live/example.com/fullchain.pem
    </ssl>
</server>

我确保 yaws 用户可以读取 key 文件和证书。 key 文件旁边是一个 README,其中包含以下内容:

`privkey.pem`  : the private key for your certificate.
`fullchain.pem`: the certificate file used in most server software.
`chain.pem`    : used for OCSP stapling in Nginx >=1.3.7.
`cert.pem`     : will break many server configurations, and should not be used
                 without reading further documentation (see link below).
We recommend not moving these files. For more information, see the Certbot
User Guide at https://certbot.eff.org/docs/using.html#where-are-my-certificates.

所以我相对确定我使用了正确的文件(其他文件给了我错误,如 badmatch{tls_alert,"decrypt error"})。我还尝试了一些琐碎的事情,比如在 URL 之前编写 https://,但它并没有解决问题,而且,当服务器在没有 SSL 的情况下运行时,一切正常。我的服务器上运行的 Erlang 版本是 Erlang/OTP 19。此外,如果不清楚,域实际上不是 example.com

此外,example.com 通过 cname 重定向到 examplecom.duckdns.org,如果这很重要的话。

更新:

我的服务器正在监听端口 8080,这是从外部端口 80 转发的,用于 https 连接,当默认 https 端口为端口 443。我的另一个错误是连接到 http://example.com 而不是 https://example.com。将外部端口 443 转发到内部端口 8443 并将 yaws 配置为监听端口 8443 修复了所有问题。

最佳答案

请务必理解,当您执行类似 curl -v https://example.com:8080 的操作时,您会遇到超时,就这样吗? (这里https协议(protocol)和端口8080当然是必须的)

当在 SSL 虚拟主机上收到未加密的请求时,可以触发接受期间的 SSL 超时。

您能否也提供以下命令的输出:

echo -e "HEAD / HTTP/1.0\r\n\r\n" | openssl s_client -connect mysite.com:8080 -ign_eof 

最后,您运行的是哪个版本的 Yaws?在哪个操作系统上?

关于ssl - 使用 SSL 的雅司给出错误 "SSL accept failed: timeout",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41819571/

相关文章:

java - 套接字超时异常 : Read timed out with NGINX configuration

mysql - 我如何在我的服务器上生成 mysql 锁定超时错误?

wordpress - WordPress崩溃,nginx和fastcgi问题?

ssl - Yaws 网络服务器通过 HTTP 运行,但不通过 HTTPS

erlang - 雅司病路线

Python:urllib.error.HTTPError:HTTP 错误 525:Origin SSL 握手错误

ssl - 如何使用通用命令强制所有网站/单个域使用 HTTPS?

python - 抓取 https ://www. thenewboston.com/时出现 "SSL: certificate_verify_failed"错误

javascript - 通过 socket.io 添加 ssl 后无法发出消息

rest - 二郎 YAWS : How to test a simple REST web service?