How openvpn/easy-rsa works
Project Type and Purpose
• This is an open-source command-line utility (“easy-rsa”) for building and managing a Public Key Infrastructure (PKI) Certificate Authority.
• It orchestrates OpenSSL to generate root/intermediate CAs, certificates, and revocation lists via shell scripts and configuration templates.
High-Level Components
a. Core CLI Engine (easyrsa3/)
• easyrsa (POSIX shell script entry point)
• openssl-easyrsa.cnf (base OpenSSL configuration)
• vars.example (environment variable template)
• x509-types/ (templates for different certificate profiles)
b. External Utility
• OpenSSL binary (invoked by the CLI engine for crypto operations)
c. Build & Packaging
• build/ (Linux/macOS build scripts & build-dist.sh)
• distro/windows/ (Windows-packaged binaries, shell environment, licenses)
d. CI/CD Pipeline
• .github/workflows/action.yml (GitHub Actions build, test, and release jobs)
e. Documentation & Tests
• doc/ (Markdown documentation, tutorials, contribution guidelines)
• README.quickstart.md, README.md, ChangeLog, KNOWN_ISSUES
• op-test.sh, wop-test.sh/.bat (smoke tests)
Relationships and Interactions
• User invokes the easyrsa CLI script →
• Reads vars (from vars.example or user override)
• Loads profile templates from x509-types/
• Calls the OpenSSL binary with generated config (openssl-easyrsa.cnf)
• Reads/writes to a file-system directory tree (PKI folder structure)
• Build system:
• Local or CI (GitHub Actions) triggers build-dist.sh →
◦ Packages the easyrsa script + supporting files into tarballs or zip archives
◦ Prepares Windows “distro/windows” ZIP with UNIX utilities and OpenSSL EXEs
• CI/CD:
• On git push or tag → runs tests (op-test.sh, wop-test.sh/bat) → uploads artifacts/releases
Architectural Patterns & Principles
• Modular Shell Orchestration: separation of script logic (easyrsa) and configuration/templates (cnf + x509-types).
• POSIX Compliance: scripts aim to run on any POSIX shell; Windows support provided via bundled utilities.
• Clear separation of concerns:
• Execution (CLI)
• Configuration (vars, profiles)
• Cryptography (external OpenSSL)
• Distribution (build scripts + packaging)
• Documentation & testing