2016-09-23 11:30:33 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Update openssl.cnf if needed (in particular section [alt_names])
|
|
|
|
|
|
|
|
rm -rf ssl
|
|
|
|
mkdir -p ssl/newcerts
|
|
|
|
touch ssl/index.txt
|
|
|
|
echo 01 > ssl/serial
|
|
|
|
echo 1000 > ssl/crlnumber
|
2018-05-02 09:28:22 +02:00
|
|
|
openssl genrsa -out ca.key 2048
|
2018-09-24 15:19:19 +02:00
|
|
|
openssl req -new -days 10000 -x509 -key ca.key -out ca.pem -batch
|
2016-09-23 11:30:33 +02:00
|
|
|
openssl genrsa -out ssl/client.key
|
2017-03-07 12:20:50 +01:00
|
|
|
openssl req -new -key ssl/client.key -out ssl/client.csr -config openssl.cnf -batch -subj /C=AU/ST=Some-State/O=Internet\ Widgits\ Pty\ Ltd/CN=localhost
|
2018-05-02 09:52:46 +02:00
|
|
|
openssl ca -keyfile ca.key -cert ca.pem -in ssl/client.csr -out ssl/client.crt -config openssl.cnf -days 10000 -batch -notext -policy policy_anything
|
2017-03-07 12:20:50 +01:00
|
|
|
openssl req -new -key ssl/client.key -out ssl/self-signed-client.csr -batch -subj /C=AU/ST=Some-State/O=Internet\ Widgits\ Pty\ Ltd/CN=localhost
|
2016-09-23 11:30:33 +02:00
|
|
|
openssl x509 -req -in ssl/self-signed-client.csr -signkey ssl/client.key -out ssl/self-signed-client.crt -days 10000
|
|
|
|
cat ssl/client.crt > cert.pem
|
|
|
|
cat ssl/self-signed-client.crt > self-signed-cert.pem
|
|
|
|
cat ssl/client.key >> cert.pem
|
|
|
|
cat ssl/client.key >> self-signed-cert.pem
|
|
|
|
rm -rf ssl
|