Files
calendar-lite/bridge/make-cert.sh
T
2026-10-15 16:35:05 +02:00

16 lines
607 B
Bash
Executable File

#!/bin/sh
# Creates the bridge's self-signed certificate (10 years) and prints the SHA-256
# fingerprint to compare with what the phone shows when you tap "Trust".
set -eu
cd "$(dirname "$0")"
mkdir -p certs
NAME=${1:-caldav-bridge}
if [ ! -f certs/bridge.key ]; then
openssl req -x509 -newkey rsa:2048 -sha256 -days 3650 -nodes \
-keyout certs/bridge.key -out certs/bridge.crt -subj "/CN=$NAME" 2>/dev/null
chmod 600 certs/bridge.key
echo "Created certs/bridge.crt"
fi
echo "SHA-256 fingerprint (must match the phone):"
openssl x509 -in certs/bridge.crt -noout -fingerprint -sha256 | cut -d= -f2