0

nginx 错误日志中的错误: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in <file> on line <no>

我可以使用 FileZilla、WinSCP 和 ftp_ssl_connect() 进行连接。但我无法使用fsockopen("ssl://domain.com", $port, $errno, $errstr, $timeout).

这个命令openssl s_client -connect domain.com:21 -starttls ftp给了我正确的输出,但是如果我删除 STARTTLS 命令,它会给出这个错误:

CONNECTED(00000003)
47404513277584:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:766:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 321 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---

谁能帮助我如何将 STARTTLS 命令放入我的 PHP 代码中?如果你们需要任何其他详细信息,请告诉我,我将编辑帖子。

4

1 回答 1

0

尝试使用 465 端口。为了获得更好的答案,请提供一些信息(一些 php 代码,或者如果您使用像 PhpMailer 这样的专用 php 类,请指定它)

于 2014-03-12T07:31:32.127 回答