1.0.0 • Published 10 months ago
@krish-59/ssl-cli v1.0.0
SSL CLI Tool
A powerful command-line tool for managing SSL certificates, both for local development and production environments. This tool simplifies the process of creating and managing SSL certificates, including setting up Nginx with Let's Encrypt certificates.
Features
- 🚀 Create local Certificate Authority (CA) for development
- 🔐 Generate SSL certificates for domains
- 🌐 Set up Nginx with Let's Encrypt certificates
- 🎨 Beautiful CLI interface with animations and colors
- 🔄 Automatic certificate renewal support
- 🛠️ Comprehensive error handling and user guidance
Installation
# Install globally
npm install -g ssl-cli
# Or install locally
npm install ssl-cliPrerequisites
- Node.js (v14 or higher)
- OpenSSL (for local certificate generation)
- Nginx (for production setup)
- Certbot (for Let's Encrypt certificates)
Available Commands
1. Basic Help Command
ssl-cli --help- Shows all available commands and their descriptions
- Provides basic usage information
- Lists command-line options
2. OpenSSL Check Command
ssl-cli check-openssl- Verifies if OpenSSL is installed on your system
- Checks if OpenSSL is properly configured in PATH
- Displays the installed OpenSSL version
- Provides installation instructions if OpenSSL is missing
3. Local CA Creation Command
ssl-cli create-local-ca- Creates a local Certificate Authority (CA) for development
- Generates a CA private key (
myCA.key) - Creates a CA certificate (
myCA.pem) - Stores files in
~/certsdirectory - Provides platform-specific installation instructions
- Features:
- Password protection for CA key
- 5-year validity period
- Secure key generation (2048-bit RSA)
- Overwrite protection for existing CA files
4. Domain Certificate Creation Command
ssl-cli create-cert- Creates SSL certificates for specific domains
- Generates certificates signed by your local CA
- Features:
- Domain name validation
- Private key generation
- Certificate signing request (CSR) creation
- Subject Alternative Names (SAN) support
- Overwrite protection for existing certificates
- Creates files:
domain.key: Private keydomain.crt: Certificatedomain.csr: Certificate signing requestdomain.ext: Extension file
5. Nginx SSL Setup Command
ssl-cli setup-nginx- Sets up Nginx with Let's Encrypt certificates
- Features:
- Nginx installation check and setup
- Certbot installation and configuration
- DNS verification setup
- Automatic certificate renewal
- Custom port configuration
- Steps:
- Checks system requirements
- Installs necessary packages
- Configures Nginx
- Sets up DNS verification
- Generates SSL certificates
- Configures automatic renewal
Common Use Cases
Local Development Setup
# 1. Create local CA
ssl-cli create-local-ca
# 2. Install CA certificate in your system/browser
# 3. Create certificates for your domains
ssl-cli create-certProduction Setup
# Set up Nginx with Let's Encrypt
ssl-cli setup-nginxTroubleshooting
# Check OpenSSL installation
ssl-cli check-opensslFeatures in Detail
Local Certificate Authority
- Generates a self-signed CA certificate
- Creates private keys with secure encryption
- Provides platform-specific installation instructions
- Supports certificate overwrite protection
Domain Certificates
- Generates certificates signed by your local CA
- Supports multiple domains and subdomains
- Creates both certificate and private key files
- Includes proper Subject Alternative Names (SAN)
Nginx Setup
- Installs and configures Nginx
- Sets up Let's Encrypt certificates
- Configures automatic renewal
- Provides DNS verification guidance
- Supports custom port configuration
Security Considerations
- Private keys are generated with strong encryption
- Certificates include proper security extensions
- Automatic renewal ensures certificates don't expire
- Proper file permissions are maintained
- Sensitive files are excluded from version control
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
ISC
Support
For support, please open an issue in the GitHub repository.
1.0.0
10 months ago