Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
Access a certificate from a template
« previous
next »
Print
Pages: [
1
]
Author
Topic: Access a certificate from a template (Read 3324 times)
Mad-Onion
Newbie
Posts: 10
Karma: 1
Access a certificate from a template
«
on:
May 06, 2020, 03:07:19 pm »
Hi everyone,
I'm developing a plugin where I need to write the content of a certificate from the OPNsense's truststore to a local file. I already have a corresponding dropdown in the form and selecting / saving works well.
How can I access the certificates "content" from within a template? When I access it via the model's property, I just get a string like "5eb0efc71fa7f" - maybe its id / hash?
Best regards
Tobias
Logged
Mad-Onion
Newbie
Posts: 10
Karma: 1
Re: Access a certificate from a template
«
Reply #1 on:
May 07, 2020, 10:05:03 am »
I'm writing these files from a php-script now. Much easier ;-)
Good example:
https://github.com/opnsense/plugins/blob/master/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportCerts.php
.
Logged
fabian
Moderator
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Access a certificate from a template
«
Reply #2 on:
May 08, 2020, 06:59:16 am »
You find that Id in the certificate section of the config as well together with the certificate itself.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
Access a certificate from a template