moq-rs/cert/fingerprint

13 lines
288 B
Plaintext
Raw Permalink Normal View History

2022-06-29 16:17:02 +00:00
#!/bin/bash
set -euo pipefail
HOST="localhost"
2022-06-29 16:17:02 +00:00
cd "$(dirname "${BASH_SOURCE[0]}")"
# Outputs the certificate fingerprint in the format Chrome expects
openssl x509 -pubkey -noout -in "${HOST}.crt" |
openssl rsa -pubin -outform der 2>/dev/null |
openssl dgst -sha256 -binary |
base64