From: Christoph Egger Date: Tue, 30 Aug 2016 11:42:36 +0000 (+0200) Subject: Properly send EHLO after TLS X-Git-Url: https://git.siccegge.de//index.cgi?p=dane-monitoring-plugins.git;a=commitdiff_plain;h=7e6fd5ecc25d728c5e061590db0efd9ee92e8d6e Properly send EHLO after TLS --- diff --git a/check_dane_smtp b/check_dane_smtp index d9c2732..c63cfed 100755 --- a/check_dane_smtp +++ b/check_dane_smtp @@ -24,6 +24,12 @@ def init_connection(sslcontext, args): connection = sslcontext.wrap_socket(socket(AF_INET), server_hostname=host) connection.connect((host, port)) + answer = connection.recv(512) + logging.debug(answer) + + connection.send(b"EHLO localhost\r\n") + answer = connection.recv(512) + logging.debug(answer) else: port = 25 if args.port == 0 else args.port @@ -43,6 +49,10 @@ def init_connection(sslcontext, args): connection = sslcontext.wrap_socket(connection, server_hostname=host) connection.do_handshake() + connection.send(b"EHLO localhost\r\n") + answer = connection.recv(512) + logging.debug(answer) + return connection