summaryrefslogtreecommitdiff
path: root/cert-info
diff options
context:
space:
mode:
Diffstat (limited to 'cert-info')
-rwxr-xr-xcert-info7
1 files changed, 4 insertions, 3 deletions
diff --git a/cert-info b/cert-info
index b4aa9b1..28865bd 100755
--- a/cert-info
+++ b/cert-info
@@ -69,7 +69,8 @@ get_cert() {
return 1
fi
</dev/null 2>/dev/null \
- timeout 5 openssl s_client -connect "$host:$port" -showcerts
+ timeout 5 openssl s_client \
+ -connect "$host:$port" -servername "$host" -showcerts
}
parse_arg() {
@@ -98,7 +99,7 @@ BEGIN {
sep=sep"-";
}
}
-/^-----BEGIN CERTIFICATE-----$/ {
+/^-----BEGIN (TRUSTED )?CERTIFICATE-----$/ {
in_cert=1;
}
{
@@ -106,7 +107,7 @@ BEGIN {
cert = cert $0 "\n";
}
}
-/^-----END CERTIFICATE-----$/ {
+/^-----END (TRUSTED )?CERTIFICATE-----$/ {
in_cert = 0;
}
{