mirror of
https://github.com/YGGverse/agate.git
synced 2026-04-08 12:35:28 +00:00
add test for multicert
This commit is contained in:
parent
635f7bc1e7
commit
f03e8e8596
10 changed files with 546 additions and 66 deletions
38
tests/data/multicert/create_certs.sh
Executable file
38
tests/data/multicert/create_certs.sh
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p example.com example.org
|
||||
|
||||
# create our own CA so we can use rustls without it complaining about using a
|
||||
# CA cert as end cert
|
||||
openssl req -x509 -newkey rsa:4096 -keyout ca_key.rsa -out ca_cert.pem -days 3650 -nodes -subj "/CN=example CA"
|
||||
|
||||
for domain in "example.com" "example.org"
|
||||
do
|
||||
openssl genpkey -out $domain/key.rsa -algorithm RSA -pkeyopt rsa_keygen_bits:4096
|
||||
|
||||
cat >openssl.conf <<EOT
|
||||
[req]
|
||||
default_bits = 4096
|
||||
distinguished_name = req_distinguished_name
|
||||
req_extensions = req_ext
|
||||
prompt = no
|
||||
|
||||
[req_distinguished_name]
|
||||
countryName = US
|
||||
stateOrProvinceName = CA
|
||||
localityName = Playa Vista
|
||||
organizationName = IANA
|
||||
commonName = $domain
|
||||
|
||||
[req_ext]
|
||||
subjectAltName = DNS:$domain
|
||||
EOT
|
||||
|
||||
openssl req -new -sha256 -out request.csr -key $domain/key.rsa -config openssl.conf
|
||||
|
||||
openssl x509 -req -sha256 -days 3650 -in request.csr -CA ca_cert.pem -CAkey ca_key.rsa \
|
||||
-CAcreateserial -out $domain/cert.pem -extensions req_ext -extfile openssl.conf
|
||||
done
|
||||
|
||||
# clean up
|
||||
rm openssl.conf request.csr ca_cert.srl
|
||||
Loading…
Add table
Add a link
Reference in a new issue