summaryrefslogtreecommitdiff
path: root/functions/cert.fish
diff options
context:
space:
mode:
Diffstat (limited to 'functions/cert.fish')
-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