直到几天前,我的 dovecot/postfix/fail2ban 设置运行得非常好:当我从外部(例如我的本地主机)连接时,我得到
CONNECTED(000002F8)
write:errno=10054
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 326 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1569483184
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
但是当我在本地连接时
me@example:/etc/dovecot/conf.d$ openssl s_client localhost:995
CONNECTED(00000005)
depth=2 O = Digital Signature Trust Co., CN = DST Root CA X3
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
verify return:1
depth=0 CN = example.com
verify return:1
---
Certificate chain
0 s:CN = example.com
i:C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
1 s:C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
i:O = Digital Signature Trust Co., CN = DST Root CA X3
---
Server certificate
-----BEGIN CERTIFICATE-----
bla
-----END CERTIFICATE-----
subject=CN = example.com
issuer=C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, P-384, 384 bits
---
SSL handshake has read 3274 bytes and written 767 bytes
Verification: OK
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
---
Post-Handshake New Session Ticket arrived:
SSL-Session:
Protocol : TLSv1.3
Cipher : TLS_AES_256_GCM_SHA384
Session-ID: bla
Session-ID-ctx:
Resumption PSK: bla
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 7200 (seconds)
TLS session ticket:
bla
Start Time: 1569483321
Timeout : 7200 (sec)
Verify return code: 0 (ok)
Extended master secret: no
Max Early Data: 0
---
read R BLOCK
---
Post-Handshake New Session Ticket arrived:
SSL-Session:
Protocol : TLSv1.3
Cipher : TLS_AES_256_GCM_SHA384
Session-ID: bla
Session-ID-ctx:
Resumption PSK: bla
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 7200 (seconds)
TLS session ticket:
bla
Start Time: 1569483321
Timeout : 7200 (sec)
Verify return code: 0 (ok)
Extended master secret: no
Max Early Data: 0
---
read R BLOCK
+OK Dovecot (Ubuntu) ready.
我搜索了日志并没有发现任何可疑的东西。毕竟,它清楚地表明我可以在 localhost 上连接并获得证书。然而从外面我可以连接(CONNECTED(000002F8)
)但我没有得到证书。
我需要在哪里看..?什么可能导致这样的问题?
谢谢!
虽然您可以先连接,但连接会被重置(10054 是 WSAECONNRESET - 对等方重置连接)。造成这种情况的可能原因是客户端和服务器之间某处的深度检查防火墙在看到 TLS 握手并且不允许此协议时阻止连接。这导致没有从服务器读取数据(“... has read 0 bytes”),因此也没有证书或 TLS 握手的任何其他服务器端部分。