bot: Changed process pipe
All checks were successful
Build Docker / Build Docker (push) Successful in 16s

This commit is contained in:
Nathan Woodburn 2023-09-27 17:31:22 +10:00
parent b42a2036d9
commit ec9421628d
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

7
bot.py
View File

@ -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: