This plugin provides automated certificate management using Step CA for
OPNsense, including certificate issuance, renewal, and automatic import into the
OPNsense web GUI. This plugin is kept simple on purpose and is only for issuing
a certificate for the OPNsens firewall box itself. if you need a more
comprehensive acme solution, prefer the os-acme-client plugin (which supports
DNS, HTTP and ALPN challenges). This plugin was created with the step-ca
tutorials in mind.
This allows configuring OPNSense according to the best practice described in acme-basics and build a tiny ca authority. It enables renewing a step-ca certificate on a short lived interval (24/12/6 hr).
NOTE: step-ca only supports the http-01 challenge. this requires checking
the Disable web GUI redirect rule (System -> Settings -> Administration)
to allow using port 80 for those challenges. Automatically shutting off web and
restarting isn't supported by this plugin yet (and may never be).
NOTE: this is only to give you firewall box HTTPS with a custom ca, not for running a CA itself on the firewall box. OPNSense already has nice utilities for that.
- Certificate issuance from Step CA servers
- Automatic certificate renewal with cron scheduling
- Automatic import of certificates into OPNsense web GUI
- Configurable CA URL, domain name, and SANs
- Support for custom Step CA instances
- OPNsense 24.x or later
- jq installed (
pkg install jq) - A configured Step CA server
the step-cli is not apart of the default opnsense package repo, so it needs to
be installed manually according to
opnsense docs.
the installation instructions are included here for convenience but please check
opnsense docs for any possible changes.
-
ssh into your opnsense firewall box (ssh settings are out of scope but may be configured via users and System->Settings->Administration)
-
use the official opnsense build system to install step-cli
opnsense-code ports
cd /usr/ports/security/step-cli
make installthen you should be able to manage step-cli from the gui like other packages.
to update from CLI,
opnsense-code ports
cd /usr/ports/security/step-cli
make reinstallUntil this plugin is available in a freebsd/opnsense repository somewhere, it needs to be installed manually. this will result in an "Orphaned" plugin on the "Plugins" page, which means it has no known repository it belongs to and so will not be auto-updated.
Directions for installing a plugin are taken from here.
-
Clone
https://github.com/opnsense/toolsinto/usr/toolson your firewall boxgit clone [email protected]:opnsense/tools.git /usr/tools(requiresroot/sudo)
-
prefetch the
base,kernel, andpackagesto avoid compiling from source (which takes a very long time)cd /usr/tools && make prefetch-base,kernel,packages
-
Navigate to
/usr/plugins/devel/and clone this repo,cd /usr/plugins/devel && git clone https://github.com/insipx/os-step-ca -
build and install the plugin
cd /usr/plugins/devel/os-step-ca && make upgrade
-
Navigate to Services > Step CA in the OPNsense web interface
-
Configure the following required fields:
- Enable: Check to enable the service
- CA URL: Your Step CA server URL (e.g.,
https://ca.example.com) - Domain Name: Primary domain for certificates (e.g.,
opnsense.example.com) - Provisioner: Step CA provisioner name (default:
acme)
-
Optional configuration:
- SAN Domains/IPs: Comma-separated list of Subject Alternative Names
Example:
10.10.69.1,192.168.1.1,*.example.com - Force Overwrite: If enabled using the
Issuecommand will create a new cert && overwrite anyexisting cert + import the new cert. - Renew Before Expiry (Default 4h): Renew certificate if it expires within this duration (e.g., 4h, 24h, 7d). Set to 0 to force renewal regardless of expiry. Used by the cron job configured in Settings -> Cron.
- SAN Domains/IPs: Comma-separated list of Subject Alternative Names
Example:
-
Click Apply to save settings. these are the settings used for actions as well as in the step ca cron job.
- In the web GUI, click the Issue button to issue your first certificate
- The certificate will be automatically imported into OPNsense and set as the web GUI certificate
- The web GUI will restart with the new certificate
The plugin includes a cron template for automatic renewal
- Going to the plugins page on OPNSense,
System -> Firmware -> Pluginsyou can click the trash icon on theos-step-caplugin to uninstall.

