- Copy the
values.sample.shfile intovalues.sh, andopenssl.sample.cnffile intoopenssl.cnf - Edit the copied file to your values.
- Generate the authority with
./gen-ca.sh. In case you have already one, go to the next section. - Copy the
mygen.sample.shfile intomygen.sh, edit it. - Run
./mygen.sh. - Wait, see, enjoy!
Each generated certificate is in the PEM format and in two files :
- One for the key, named "foo.ca.key"
- Another for the certificate, named "foo.ca.crt"
Then, you know what you have to do :)
Use the gen_ident_certs, as described in sample to generate PKCS12 authentication certificates.
If you want to protect your p12 with a randomly generated password:
export persons="PersonName:protect
PersonName2:protectSSLEngine On
SSLCertificateFile /etc/ssl/www-localhost.crt
SSLCertificateKeyFile /etc/ssl/www-localhost.key
SSLCACertificateFile /etc/ssl/myca.ca.crt
SSLVerifyClient require
ssl on;
ssl_certificate /etc/ssl/www-localhost.crt;
ssl_certificate_key /etc/ssl/www-localhost.key;
ssl_client_certificate /etc/ssl/myca.ca.crt;
ssl_verify_client on;
Just use the shell: exporting variables used by the "values.sh" script will just make them the default for the rest of your shell's life.