mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/haproxy: use CA/intermediate certificates if required
This commit is contained in:
committed by
Franco Fichtner
parent
a99da6d608
commit
9b462a7ed8
@@ -73,6 +73,12 @@ foreach ($configNodes as $key => $value) {
|
||||
} else {
|
||||
$pem_content = str_replace("\n\n", "\n", str_replace("\r", "", base64_decode((string)$cert->crt)));
|
||||
$pem_content .= "\n" . str_replace("\n\n", "\n", str_replace("\r", "", base64_decode((string)$cert->prv)));
|
||||
// check if a CA is linked
|
||||
if (!empty((string)$cert->caref)) {
|
||||
$cert = (array)$cert;
|
||||
$ca = ca_chain($cert);
|
||||
$pem_content .= $ca;
|
||||
}
|
||||
}
|
||||
// generate pem file
|
||||
$output_pem_filename = "/var/etc/haproxy/ssl/" . $cert_refid . ".pem";
|
||||
|
||||
Reference in New Issue
Block a user