mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
fix trusted CAs pem for upstream verify (#2198)
This commit is contained in:
@@ -198,16 +198,15 @@ if (isset($nginx['upstream'])) {
|
||||
}
|
||||
if (!empty($upstream['tls_trusted_certificate'])) {
|
||||
$cas = array();
|
||||
if (is_array($http_server['ca'])) {
|
||||
foreach ($http_server['ca'] as $caref) {
|
||||
$ca = find_ca($caref);
|
||||
if (isset($ca)) {
|
||||
$cas[] = $ca;
|
||||
}
|
||||
}
|
||||
$carefs = explode(",", $upstream['tls_trusted_certificate']);
|
||||
foreach ($carefs as $caref) {
|
||||
$ca = find_ca($caref);
|
||||
if (isset($ca)) {
|
||||
$cas[] = base64_decode($ca['crt']);
|
||||
}
|
||||
}
|
||||
export_pem_file(
|
||||
'/usr/local/etc/nginx/key/trust_upstream_' . $upstream_uuid . '.pem',
|
||||
'/usr/local/etc/nginx/key/trust_upstream_' . $upstream_uuid . '.pem','',
|
||||
implode("\n", $cas)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user