Skip to content

Commit 7de4dc2

Browse files
committed
Include SMTP EHLO rejection response in raised exception
1 parent 49380c1 commit 7de4dc2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sslyze/connection_helpers/opportunistic_tls_helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ def prepare_socket_for_tls_handshake(self, sock: socket.socket) -> None:
6767

6868
# Send a EHLO and wait for the 250 status
6969
sock.send(b"EHLO sslyze.scan\r\n")
70-
if b"250 " not in sock.recv(2048):
71-
raise OpportunisticTlsError("SMTP EHLO was rejected")
70+
data = sock.recv(2048)
71+
if b"250 " not in data:
72+
raise OpportunisticTlsError(f"SMTP EHLO was rejected: {repr(data)}")
7273

7374
# Send a STARTTLS
7475
sock.send(b"STARTTLS\r\n")

0 commit comments

Comments
 (0)