PHP CURL 很少发生 SSL 连接错误

PHP CURL rarely SSL connect error

我们有一个 nginx 网络服务器实例,我们的一些应用程序使用它。上次我们开始获得 cURL error #35 - SSL connect error。但是我们不会每 100 个请求连续获得大约 2-3 次。请求来自不同的来源(C# 应用程序、Unix 应用程序、一些 php 脚本等),我很困惑,因为我们找不到这个问题的原因。

curl_setopt($ch, CURLOPT_SSLVERSION, 3); 完全失败了。

会是什么?

来自 libcurl 网站,它指出:

CURLE_SSL_CONNECT_ERROR (35)

A problem occurred somewhere in the SSL/TLS handshake. You really want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates (file formats, paths, permissions), passwords, and others

当然,使用 PHP 脚本应该可以编辑它们,以便有一些额外的调试信息可用于帮助调试(可以写入文本文件等)- 如果错误仍然存​​在并且有调试信息中没有信息,那么至少你已经消除了一个来源。我不知道您如何为 unix 应用程序或 c# 应用程序做同样的事情——很可能会有办法。