ssl: Add arg to show certificate
All checks were successful
Build Docker / Build Docker (push) Successful in 16s
All checks were successful
Build Docker / Build Docker (push) Successful in 16s
This commit is contained in:
parent
f988e49cdc
commit
c782e17028
5
bot.py
5
bot.py
@ -131,7 +131,7 @@ async def curl(ctx, url: str):
|
||||
await ctx.response.send_message(f"An error occurred: {e}")
|
||||
|
||||
@tree.command(name="ssl", description="Check SSL certificate")
|
||||
async def ssl(ctx, domain: str):
|
||||
async def ssl(ctx, domain: str, showcert: bool = False):
|
||||
# Verify that the domain is valid
|
||||
if not domain:
|
||||
await ctx.response.send_message("Please provide a domain to check")
|
||||
@ -184,7 +184,8 @@ async def ssl(ctx, domain: str):
|
||||
|
||||
if certificates:
|
||||
cert = certificates[0]
|
||||
message = message + "\n## Website Certificate:\n```\n" + cert + "\n```\n"
|
||||
if showcert:
|
||||
message = message + "\n## Website Certificate:\n```\n" + cert + "\n```\n"
|
||||
|
||||
with tempfile.NamedTemporaryFile(mode="w", delete=False) as temp_cert_file:
|
||||
temp_cert_file.write(cert)
|
||||
|
Loading…
Reference in New Issue
Block a user