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
3
bot.py
3
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,6 +184,7 @@ async def ssl(ctx, domain: str):
|
||||
|
||||
if certificates:
|
||||
cert = certificates[0]
|
||||
if showcert:
|
||||
message = message + "\n## Website Certificate:\n```\n" + cert + "\n```\n"
|
||||
|
||||
with tempfile.NamedTemporaryFile(mode="w", delete=False) as temp_cert_file:
|
||||
|
Loading…
Reference in New Issue
Block a user