blob: 253e4bb31acf76b2f4131c85a19a45905b7eb2df (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#!/bin/sh
# For a public or production server, purchase a cert from a known CA, and skip
# the next step.
# For development, testing and personal server management, create a CA key and
# cert, and use that to generate a server key and cert. Creates:
# ca.key.pem
# ca.cert.pem
# server.key.pem
# server.cert.pem
GENERATION_LOCATION="/run/user/$(id -u)/taskserver/keys";
mkdir -p "$GENERATION_LOCATION"
cp ./vars ./generate.ca ./generate.crl ./generate.client "$GENERATION_LOCATION"
cd "$GENERATION_LOCATION" || echo "(BUG?) No possible location fould!" 1>&2
./generate.ca
# Generate a certificate revocation list (CRL). The initial CRL is empty, but
# can grow over time. Creates:
# server.crl.pem
./generate.crl
# The above is sufficient to operate a server. You now need to run a client cert creation
# process per client; Add the required client names and uncomment
# ./generate.client <client_name>
#
./generate.client soispha
./generate.client android-mobile
./generate.client android-tab
#
# Creates:
# <client_name>.key.pem
# <client_name>.cert.pem
rm ./vars ./generate.ca ./generate.crl ./generate.client
echo "(INFO) Look for the keys at: $GENERATION_LOCATION"
|