Project

certgen

0.0
The project is in a healthy, maintained state
Certgen is a command-line Ruby gem that helps users generate free SSL certificates from Let's Encrypt using DNS-01 verification. Ideal for users with manual or cPanel-based hosting environments. Supports wildcard domains and reusable account keys.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 2.0.21
~> 2.4.1
 Project Readme

Certgen

Ruby License: MIT Gem Version

Certgen is a Ruby CLI tool to generate free SSL certificates from Let's Encrypt using DNS-01 verification. Perfect for developers and site owners who use cPanel or manually managed servers and need to upload certificates themselves.

✨ Features

  • βœ… Generate valid SSL certificates via Let's Encrypt
  • 🌐 Supports both base domains and www. subdomains automatically
  • πŸ” Uses DNS-01 challenge (great for wildcard and shared hosting)
  • πŸ“ Outputs .crt, .pem, and zipped bundles for easy upload
  • πŸ”„ Stores reusable Let's Encrypt account key
  • πŸ–₯️ CLI interface for quick and easy usage

πŸ“¦ Installation

gem install certgen

πŸš€ Usage

πŸ”§ Testing with Let’s Encrypt Production

Run the CLI tool from your terminal:

certgen --domain example.com --email user@example.com

This above command will overall:

  1. Generate or reuse your Let's Encrypt account key
  2. Create DNS-01 challenge instructions
  3. Wait for your confirmation after DNS is set
  4. Generate the certificate files
  5. Zip them for upload to cPanel or any hosting service

πŸ”§ Testing with Let’s Encrypt Staging

To avoid hitting rate limits during development or testing, use the Let’s Encrypt staging environment:

certgen test --domain example.com --email you@example.com
  • This runs the same generation process but against the staging ACME server.
  • Useful for verifying DNS setup and automation without generating real certificates.

πŸ”„ Example Output Files

After running, your certs will be saved in:

~/.ssl_output/example.com/
β”œβ”€β”€ certificate.crt
β”œβ”€β”€ private_key.pem
β”œβ”€β”€ ca_bundle.pem
└── cert_bundle.zip

✍️ DNS Setup

You'll be prompted to create a DNS TXT record:

Record Name: _acme-challenge.example.com
Record Type: TXT
Record Value: abc123...

Use https://dnschecker.org to confirm propagation before continuing.

πŸ”§ Development

Clone and run locally:

git clone https://github.com/cdrrazan/certgen
cd certgen
bundle install

Run the CLI locally:

bin/certgen --domain example.com --email user@example.com

βœ… Requirements

  • Ruby >= 3
  • DNS management access to create TXT records
  • cPanel or similar manual SSL upload support

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

πŸ™Œ Author

Rajan Bhattarai
GitHub β€’ Email


πŸ›  Contributions and issues are welcome β€” feel free to open a PR or issue on GitHub!