summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorache <ache@ache.one>2023-01-27 02:17:45 +0100
committerache <ache@ache.one>2023-01-27 02:17:45 +0100
commita470ed7eaed3b74f41fd0f4b964db555cc457b7f (patch)
tree2c847a1db84b10ccac12ff1f2b134e0228bb040c /functions
parentUsefull ansiStrip (diff)
Get the HTTPS certificat of a website
Diffstat (limited to 'functions')
-rw-r--r--functions/cert.fish5
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