mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Add generete-csr.sh script to examples.
This commit is contained in:
parent
635e585226
commit
60cc025658
3 changed files with 36 additions and 0 deletions
3
examples/.gitignore
vendored
Normal file
3
examples/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# generate-csr.sh:
|
||||
/key.pem
|
||||
/csr.der
|
||||
28
examples/generate-csr.sh
Executable file
28
examples/generate-csr.sh
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
# This script generates a simple SAN CSR to be used with Let's Encrypt
|
||||
# CA. Mostly intedened for "auth --csr" testing, but, since its easily
|
||||
# auditable, feel free to adjust it and use on you production web
|
||||
# server.
|
||||
|
||||
if [ "$#" -lt 1 ]
|
||||
then
|
||||
echo "Usage: $0 domain [domain...]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
domains="DNS:$1"
|
||||
shift
|
||||
for x in "$@"
|
||||
do
|
||||
domains="$domains,DNS:$x"
|
||||
done
|
||||
|
||||
SAN="$domains" openssl req -config openssl.cnf \
|
||||
-new -nodes -subj '/' -reqexts san \
|
||||
-out csr.der \
|
||||
-keyout key.pem \
|
||||
-newkey rsa:2048 \
|
||||
-outform DER
|
||||
# 512 or 1024 too low for Boulder, 2048 is smallest for tests
|
||||
|
||||
echo "You can now run: letsencrypt auth --csr csr.der"
|
||||
5
examples/openssl.cnf
Normal file
5
examples/openssl.cnf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[ req ]
|
||||
distinguished_name = req_distinguished_name
|
||||
[ req_distinguished_name ]
|
||||
[ san ]
|
||||
subjectAltName=${ENV::SAN}
|
||||
Loading…
Reference in a new issue