summaryrefslogtreecommitdiff
path: root/ci/docker/createcert.sh
blob: 1d55e6f1f95cb9571d1f8dbaa42767c526b68d44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash
# Get absolute path to current directory this script is in
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

WEB_FQDN="eduvpnserver"

# Create self signed cert and key
openssl req \
	-nodes \
	-subj "/CN=${WEB_FQDN}" \
	-x509 \
	-sha256 \
	-newkey rsa:2048 \
	-keyout "${SCRIPT_DIR}/selfsigned/${WEB_FQDN}.key" \
	-out "${SCRIPT_DIR}/selfsigned/${WEB_FQDN}.crt" \
	-addext "subjectAltName = DNS:${WEB_FQDN}" \
	-days 90