mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Only write out the CA if one exists.
This commit is contained in:
parent
812dd35db0
commit
dc291feb70
@ -536,20 +536,22 @@ function vpn_ipsec_configure($ipchg = false)
|
||||
chmod($keypath, 0600);
|
||||
|
||||
$ca = lookup_ca($cert['caref']);
|
||||
$cafile = "ca-".$ikeid.".crt";
|
||||
$capath = $g['varetc_path']."/".$cafile;
|
||||
if ($ca) {
|
||||
$cafile = "ca-".$ikeid.".crt";
|
||||
$capath = $g['varetc_path']."/".$cafile;
|
||||
|
||||
if (!file_put_contents($capath, base64_decode($ca['crt'])))
|
||||
{
|
||||
log_error("Error: Cannot write phase1 CA certificate file for {$ph1ent['name']}");
|
||||
continue;
|
||||
if (!file_put_contents($capath, base64_decode($ca['crt'])))
|
||||
{
|
||||
log_error("Error: Cannot write phase1 CA certificate file for {$ph1ent['name']}");
|
||||
continue;
|
||||
}
|
||||
|
||||
chmod($capath, 0600);
|
||||
$caline = "ca_type x509 \"".basename($capath)."\";";
|
||||
}
|
||||
|
||||
chmod($capath, 0600);
|
||||
|
||||
$certline = "certificate_type x509 \"".basename($certpath)."\" \"".basename($keypath)."\";";
|
||||
|
||||
$caline = "ca_type x509 \"".basename($capath)."\";";
|
||||
}
|
||||
|
||||
$ealgos = '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user