Eu tinha uma configuração dovecot/postfix/fail2ban funcionando perfeitamente até alguns dias atrás: Quando eu me conecto de fora (por exemplo, meu host local), recebo
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)
---
Mas quando eu me conecto localmente
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.
Pesquisei nos registros e não encontrei nada suspeito. E, afinal, diz claramente que posso me conectar no localhost e obter o certificado. No entanto, de fora consigo conectar ( CONNECTED(000002F8)
), mas não recebo um certificado.
Onde preciso procurar..? O que poderia causar tal problema?
Obrigado!
Responder1
write:errno=10054
...
O handshake SSL leu 0 bytes e gravou 326 bytes
Embora você possa se conectar primeiro, a conexão será redefinida (10054 é WSAECONNRESET - Conexão redefinida por peer). A possível causa disso é um firewall de inspeção profunda em algum lugar entre o cliente e o servidor que bloqueia a conexão quando vê um handshake TLS e este protocolo não é permitido. Isso resulta em nenhuma leitura de dados do servidor ("... leu 0 bytes") e, portanto, também nenhum certificado ou qualquer outra parte do handshake TLS no lado do servidor.