From 463adfc2bad2c7d3c5c3d82749d840b495fd01bb Mon Sep 17 00:00:00 2001 From: bneradt Date: Wed, 10 Jun 2020 21:56:10 +0000 Subject: [PATCH] microserver error handling: SSLError check and debug. --- tests/gold_tests/autest-site/microserver.test.ext | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/gold_tests/autest-site/microserver.test.ext b/tests/gold_tests/autest-site/microserver.test.ext index decbf2c696e..94c82943f91 100644 --- a/tests/gold_tests/autest-site/microserver.test.ext +++ b/tests/gold_tests/autest-site/microserver.test.ext @@ -21,6 +21,7 @@ import socket import ssl from autest.api import AddWhenFunction +import hosts.output as host from ports import get_port import trlib.ipconstants as IPConstants @@ -132,6 +133,16 @@ def uServerUpAndRunning(serverHost, port, isSsl, isIPv6, request, clientcert='', try: sock.connect((serverHost, port)) except ConnectionRefusedError: + host.WriteDebug( + ['uServerUpAndRunning', 'when'], + "Connection refused: {0}:{1}".format( + serverHost, port)) + return False + except ssl.SSLError: + host.WriteDebug( + ['uServerUpAndRunning', 'when'], + "SSL connection error: {0}:{1}".format( + serverHost, port)) return False sock.sendall(request.encode())