diff options
author | ache <ache@ache.one> | 2023-01-27 02:17:45 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2023-01-27 02:17:45 +0100 |
commit | a470ed7eaed3b74f41fd0f4b964db555cc457b7f (patch) | |
tree | 2c847a1db84b10ccac12ff1f2b134e0228bb040c /functions | |
parent | Usefull ansiStrip (diff) |
Get the HTTPS certificat of a website
Diffstat (limited to 'functions')
-rw-r--r-- | functions/cert.fish | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/functions/cert.fish b/functions/cert.fish new file mode 100644 index 0000000..b909faa --- /dev/null +++ b/functions/cert.fish @@ -0,0 +1,5 @@ +function cert -d "Retrieve the SSL certificat of a HTTPS website from the servername" + # PEM format + echo "Certificat of $argv[1] on port 443 (PEM format)" + openssl s_client -servername $argv[1] -connect $argv[1]:443 2>/dev/null </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' +end |