/certificate_generator

This scrip is aimed to generate root and intermediate CA, then generate certificate intended for internal use

Primary LanguageShellGNU General Public License v3.0GPL-3.0

certificate_generator

Tonton Jo

Join the community:

Youtube Discord Tonton Jo

Support my work, give a thanks and help the youtube channel:

Ko-Fi Infomaniak Express VPN

Sources:

Stackoverflow

Demonstration:

Youtube

Description:

This script aims to create a root CA, an intermediate CA and then certificates, wildcard or not, for your hosts in dedicated subfolders.
After generation, a subfolder named "hosts-certs\*\pack" who contain the root, intermediate and fullchain certificate will be created The script also generate a bat script named certificate_importer.bat in each pack folder intended to import all certificates for trust on Windows hosts.

I'm not very used to certificates generation and management so if you find something strange, please let me know or make a PR.

Usage:

  • Ensure you have openssl installed
apt-get install openssl
  • Download script
wget -q -O certificate_generator.sh https://github.com/Tontonjo/certificate_generator/raw/main/certificate_generator.sh
  • Open it, and edit the "settings" section according to your needs
    • Generate a wildcard certificate:
bash certificate_generator.sh
    • Generate a dedicated certificate for one or more hosts - Each host will have his own certificate and private key
bash certificate_generator.sh server1 server2 server3
  • You should now have a folder named "certificate" with all your certificates.
    • Certificates for your hosts are located in "hosts-certs"

If you want to add trust of your new certificate for your hosts, depending on them, you need to import fullchain and / or root and intermediate certificates.

  • For windows hosts, you can copy the "pack" folder and run certificate_importer.bat on each host you want.