Simple setup to create your own CA This code sets up a simple Certificate Authority (CA) for generating SSL/TLS certificates:
- It initializes the CA setup by executing
bootstrap.sh
, which sets up the necessary directory structure and configuration files. - It creates the CA root certificate chain by running
create_cachain.sh
. - It generates a server certificate for the current machine (identified by
hostname -f
) usinggen_server_cert.sh
. This script generates a private key, a certificate signing request (CSR), and then signs the CSR to create the server certificate. - Finally, it exports the generated certificate and its private key to the specified destination folder (
/home
in this case) usingexport.sh
. If the-k
option is provided, it also exports the private key.
echo "Welcome" > passfile
bash bootstrap.sh
bash create_cachain.sh
bash gen_server_cert.sh `hostname -f`
bash export.sh -i intermediate -c `hostname -f` -d /home -k