certifix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit ed53c967d76195ba6115af1580cb621a6cae379e
parent 8a7287d5523741a7336251e71b1ac79e23106713
Author: Daniel Barlow <dan@telent.net>
Date:   Wed, 25 Sep 2024 12:01:21 +0100

improve README

Diffstat:
MREADME | 17++++++++++++-----
Aopenssl.cnf | 19+++++++++++++++++++
2 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/README b/README @@ -7,16 +7,23 @@ but without the rest of Puppet [ This README is speculative ] ---- +## Try it out -DOMAIN="/C=GB/ST=London/L=London/O=Telent" +``` +# create CA key and cert +openssl genrsa -out ca.key 4096 +CN=CA openssl req -config openssl.cnf -x509 -new -nodes -key ca.key -sha256 -days 3650 -out ca.crt -openssl genrsa -out ca.key 4096 -openssl req -x509 -new -nodes -key ca.key -sha256 -days 3650 -subj "${DOMAIN}/CN=CA" -out ca.crt +# create client CSR +CN=rotuer openssl req -config openssl.cnf -newkey rsa:2048 -nodes -keyout client.key -out client.csr -openssl req -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr -subj "${DOMAIN}/OU=devices/CN=rotuer" +# start the server +bin/certifix +# send it +curl -v -H 'content-type: application/x-pem-file' --data-binary @client.csr http://localhost:8201/sign +``` https://www.puppet.com/docs/puppet/7/ssl_attributes_extensions#csr_custom_attributes-recommended-oids-custom-attributes diff --git a/openssl.cnf b/openssl.cnf @@ -0,0 +1,19 @@ +[ req ] +default_bits = 2048 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no + +dirstring_type = nobmp + +[ req_distinguished_name ] +countryName = GB +stateOrProvinceName = London +localityName = London +organizationName = Telent +commonName = $ENV::CN + +[ req_attributes ] +challengePassword = loves labours lost + +