我嘗試通過fsockopen
連接到sendm.cert.legalmail.it
在465
端口,這是SMTPS服務在意大利稱爲PEC。PHP握手失敗TLS1.0
隨着我已經試過這個片段的工作PHP的任何版本:
<?php
fsockopen('tls://sendm.cert.legalmail.it', 465);
所有它的確定與OpenSSL 1.0.2h
,如果我升級到OpenSSL 1.0.2j
這個片段失敗,此錯誤:
PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure in ~/Development/experimental/php-handshake/connect.php on line 3
PHP Warning: fsockopen(): Failed to enable crypto in ~/Development/experimental/php-handshake/connect.php on line 3
PHP Warning: fsockopen(): unable to connect to tls://sendm.cert.legalmail.it:465 (Unknown error) in ~/Development/experimental/php-handshake/connect.php on line 3
因此,與OpenSSL 1.0.2j
我嘗試通過命令行連接:
openssl s_client -connect sendm.cert.legalmail.it:465
它完美地工作。
我嘗試檢查SSL服務器上testssl這是轉儲(剝離):
SSLv2 not offered (OK)
SSLv3 not offered (OK)
TLS 1 offered
TLS 1.1 not offered
TLS 1.2 not offered
Version tolerance downgraded to TLSv1.0 (OK)
只有TLS 1
是繳費,我嘗試握手強制TLS1與此URI:'tlsv1.0:://sendm.cert.legalmail.it'
但結果是一樣。
我在Ubuntu 16.04上,使用PHP5.6和PHP7.1進行了測試。
錯誤在哪裏?在openssl中?在PHP中?在服務器握手?
更新如果我在chiper看起來總是./testssl.sh -E sendm.cert.legalmail.it:465
與OpenSSL 1.0.2j
回報:
x05 RC4-SHA RSA RC4 128 TLS_RSA_WITH_RC4_128_SHA
x04 RC4-MD5 RSA RC4 128 TLS_RSA_WITH_RC4_128_MD5
x16 EDH-RSA-DES-CBC3-SHA DH 1024 3DES 168 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
x0a DES-CBC3-SHA RSA 3DES 168 TLS_RSA_WITH_3DES_EDE_CBC_SHA
x15 EDH-RSA-DES-CBC-SHA DH 1024 DES 56 TLS_DHE_RSA_WITH_DES_CBC_SHA
x09 DES-CBC-SHA RSA DES 56 TLS_RSA_WITH_DES_CBC_SHA
x14 EXP-EDH-RSA-DES-CBC-SHA DH(512) DES 40,exp TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
x08 EXP-DES-CBC-SHA RSA(512) DES 40,exp TLS_RSA_EXPORT_WITH_DES40_CBC_SHA
x06 EXP-RC2-CBC-MD5 RSA(512) RC2 40,exp TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5
x03 EXP-RC4-MD5 RSA(512) RC4 40,exp TLS_RSA_EXPORT_WITH_RC4_40_MD5
隨着版本OpenSSL 1.0.2h
x05 RC4-SHA RSA RC4 128
x04 RC4-MD5 RSA RC4 128
x16 EDH-RSA-DES-CBC3-SHA DH 1024 3DES 168
x0a DES-CBC3-SHA RSA 3DES 168
和PHP常量OPENSSL_DEFAULT_STREAM_CIPHERS
是一樣翻過所有versione它包含:
ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128:AES256:HIGH:!SSLv2:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!RC4:!ADH
但這個問題不是關於證書驗證,它握手失敗。 – Cronos