Skip to content

Commit

Permalink
fix(nix): certp
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Mar 8, 2024
1 parent 94588fd commit a6b0c1c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkgs/bins/bin/certp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/sh
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p openssl
# vim: set ft=bash
# prints the certificate of a given domain
set -e
if test $# -gt 0; then
echo |
openssl s_client -showcerts -servername "$1" -connect "$1:443" 2>/dev/null |
openssl x509 -inform pem -noout -text
echo |
openssl s_client -showcerts -servername "$1" -connect "$1:443" 2>/dev/null |
openssl x509 -inform pem -noout -text
else
echo "first argument need to be a domain" >&2
exit 1
echo "first argument need to be a domain" >&2
exit 1
fi

0 comments on commit a6b0c1c

Please sign in to comment.