From ec9421628d0d5e6d90fdd0f5814c3d37b70ed16b Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 27 Sep 2023 17:31:22 +1000 Subject: [PATCH] bot: Changed process pipe --- bot.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 761692e..926dd01 100644 --- a/bot.py +++ b/bot.py @@ -153,10 +153,10 @@ async def ssl(ctx, domain: str): ip = records[0] # Run the openssl s_client command - s_client_command = ["openssl","s_client","-showcerts","-connect",f"{ip}:443","-servername",domain,"<","/dev/null",] + s_client_command = ["openssl","s_client","-showcerts","-connect",f"{ip}:443","-servername",domain,] - s_client_process = subprocess.Popen(s_client_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - s_client_output, _ = s_client_process.communicate() + s_client_process = subprocess.Popen(s_client_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) + s_client_output, _ = s_client_process.communicate(input=b"\n") certificates = [] current_cert = "" @@ -201,7 +201,6 @@ async def ssl(ctx, domain: str): ] tlsa_process = subprocess.Popen(" ".join(tlsa_command), shell=True, stdout=subprocess.PIPE) tlsa_output, _ = tlsa_process.communicate() - message = message + "\n## TLSA Record from webserver: `3 1 1 " + tlsa_output.decode("utf-8") + "`\n" await ctx.response.send_message(message) else: