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: