moq-rs/cert/fingerprint

13 lines
288 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
HOST="localhost"
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