Skip to content

Script to import an SSL certificate into a running OPNsense system

License

Notifications You must be signed in to change notification settings

Peronia/opnsense-import-certificate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

opnsense-import-certificate

Script to import an SSL certificate into a running opnsense system. The webgui will be restarted. The last certifcate in the webgui will be overwritten.

Usage

Preconditions

Since the last certifcate will be overwritten:

  • the last certificate should be the one to be overwritten
  • the certificate must be imported manually for the first time

Ideally, it looks like this before the script run the first time (system/security/certificates in webgui):

firefox_vfqVCBtGCs

  • first the self-signed certificate (will not be deleted)
  • last the certificate that should get overwritten
  • the name of the certificate doesn't matter

In Code

php opnsense-import-certificate.php /path/to/certificate.crt /path/to/private/key.pem

Automation example with acme.sh

Create a renew hook:

acme.sh --renew --dns dns_provider -d first.dom.ain -d '*.first.dom.ain' --renew-hook "php opnsense-import-certificate.php /path/to/certificate.crt /path/to/private/key.pem"

Whenever acme.sh has successfully renewed the certificate, the hook is executed. See the documentation.
Alternatively, you can use deployhooks.

About

Script to import an SSL certificate into a running OPNsense system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%