$output\n"; @@ -523,14 +628,15 @@ END } ### -### Download ca certificate +### Export ca certificate to browser ### } elsif ($cgiparams{'ACTION'} eq $Lang::tr{'download ca certificate'}) { &General::readhasharray("${General::swroot}/vpn/caconfig", \%cahash); if ( -f "${General::swroot}/ca/$cahash{$cgiparams{'KEY'}}[0]cert.pem" ) { + print "Content-Type: application/force-download\n"; print "Content-Type: application/octet-stream\r\n"; - print "Content-Disposition: filename=$cahash{$cgiparams{'KEY'}}[0]cert.pem\r\n\r\n"; + print "Content-Disposition: attachment; filename=$cahash{$cgiparams{'KEY'}}[0]cert.pem\r\n\r\n"; print `/usr/bin/openssl x509 -in ${General::swroot}/ca/$cahash{$cgiparams{'KEY'}}[0]cert.pem`; exit(0); } else { @@ -549,10 +655,7 @@ END my $test = `/usr/bin/openssl verify -CAfile ${General::swroot}/ca/$cahash{$cgiparams{'KEY'}}[0]cert.pem ${General::swroot}/certs/$confighash{$key}[1]cert.pem`; if ($test =~ /: OK/) { # Delete connection - if ($vpnsettings{'ENABLED'} eq 'on' || - $vpnsettings{'ENABLED_BLUE'} eq 'on') { - system('/usr/local/bin/ipsecctrl', 'D', $key); - } + system('/usr/local/bin/ipsecctrl', 'D', $key) if (&vpnenabled); unlink ("${General::swroot}/certs/$confighash{$key}[1]cert.pem"); unlink ("${General::swroot}/certs/$confighash{$key}[1].p12"); delete $confighash{$key}; @@ -586,17 +689,26 @@ END if ($assignedcerts) { &Header::showhttpheaders(); &Header::openpage($Lang::tr{'vpn configuration main'}, 1, ''); - &Header::openbigbox('100%', 'LEFT', '', ''); - &Header::openbox('100%', 'LEFT', $Lang::tr{'are you sure'}); + &Header::openbigbox('100%', 'left', '', ''); + &Header::openbox('100%', 'left', $Lang::tr{'are you sure'}); print <
| $Lang::tr{'organization name'}: | -- | ||
| $Lang::tr{'ipfires hostname'}: | -- | ||
$Lang::tr{'your e-mail'}: ![]() |
- - | ||
$Lang::tr{'your department'}: ![]() |
- - | ||
$Lang::tr{'city'}: ![]() |
- - | ||
$Lang::tr{'state or province'}: ![]() |
- - | ||
| $Lang::tr{'country'}: | -- | ||
| - | |||
- $Lang::tr{'this field may be blank'} |
- - $Lang::tr{'capswarning'}: - $Lang::tr{'generating the root and host certificates may take a long time. it can take up to several minutes on older hardware. please be patient'} - | ||
| $Lang::tr{'upload p12 file'}: | -- | ||
$Lang::tr{'pkcs12 file password'}: ![]() |
- - | ||
| - | - | ||
- $Lang::tr{'this field may be blank'} | |||
| $Lang::tr{'organization name'}: | +|
| $Lang::tr{'ipcops hostname'}: | +|
$Lang::tr{'your e-mail'}: ![]() |
+ |
$Lang::tr{'your department'}: ![]() |
+ |
$Lang::tr{'city'}: ![]() |
+ |
$Lang::tr{'state or province'}: ![]() |
+ |
| $Lang::tr{'country'}: | +|
$Lang::tr{'vpn subjectaltname'} (subjectAltName=email:*,URI:*,DNS:*,RID:*) ![]() |
+ |
| + | |
| + $Lang::tr{'capswarning'}: + $Lang::tr{'generating the root and host certificates may take a long time. it can take up to several minutes on older hardware. please be patient'} + | |
| $Lang::tr{'upload p12 file'}: | +|
$Lang::tr{'pkcs12 file password'}: ![]() |
+ |
| + | |
+ $Lang::tr{'this field may be blank'} | |
$output\n"; @@ -1092,14 +1159,14 @@ END } ### -### Download Certificate +### Export Certificate to browser ### } elsif ($cgiparams{'ACTION'} eq $Lang::tr{'download certificate'}) { &General::readhasharray("${General::swroot}/vpn/config", \%confighash); if ( -f "${General::swroot}/certs/$confighash{$cgiparams{'KEY'}}[1]cert.pem") { - print "Content-Disposition: filename=" . $confighash{$cgiparams{'KEY'}}[1] . "cert.pem\r\n"; - print "Content-Type: application/octet-stream\r\n\r\n"; + print "Content-Type: application/force-download\n"; + print "Content-Disposition: attachment; filename=" . $confighash{$cgiparams{'KEY'}}[1] . "cert.pem\n\n"; print `/bin/cat ${General::swroot}/certs/$confighash{$cgiparams{'KEY'}}[1]cert.pem`; exit (0); } @@ -1117,20 +1184,14 @@ END $confighash{$cgiparams{'KEY'}}[0] = 'on'; &General::writehasharray("${General::swroot}/vpn/config", \%confighash); &writeipsecfiles(); - if ($vpnsettings{'ENABLED'} eq 'on' || - $vpnsettings{'ENABLED_BLUE'} eq 'on') { - system('/usr/local/bin/ipsecctrl', 'S', $cgiparams{'KEY'}); - sleep $sleepDelay; - } + system('/usr/local/bin/ipsecctrl', 'S', $cgiparams{'KEY'}) if (&vpnenabled); } else { $confighash{$cgiparams{'KEY'}}[0] = 'off'; - if ($vpnsettings{'ENABLED'} eq 'on' || - $vpnsettings{'ENABLED_BLUE'} eq 'on') { - system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'}); - } &General::writehasharray("${General::swroot}/vpn/config", \%confighash); &writeipsecfiles(); + system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'}) if (&vpnenabled); } + sleep $sleepDelay; } else { $errormessage = $Lang::tr{'invalid key'}; } @@ -1143,8 +1204,7 @@ END &General::readhasharray("${General::swroot}/vpn/config", \%confighash); if ($confighash{$cgiparams{'KEY'}}) { - if ($vpnsettings{'ENABLED'} eq 'on' || - $vpnsettings{'ENABLED_BLUE'} eq 'on') { + if (&vpnenabled) { system('/usr/local/bin/ipsecctrl', 'S', $cgiparams{'KEY'}); sleep $sleepDelay; } @@ -1160,10 +1220,7 @@ END &General::readhasharray("${General::swroot}/vpn/config", \%confighash); if ($confighash{$cgiparams{'KEY'}}) { - if ($vpnsettings{'ENABLED'} eq 'on' || - $vpnsettings{'ENABLED_BLUE'} eq 'on') { - system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'}); - } + system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'}) if (&vpnenabled); unlink ("${General::swroot}/certs/$confighash{$cgiparams{'KEY'}}[1]cert.pem"); unlink ("${General::swroot}/certs/$confighash{$cgiparams{'KEY'}}[1].p12"); delete $confighash{$cgiparams{'KEY'}}; @@ -1177,20 +1234,23 @@ END ### Choose between adding a host-net or net-net connection ### } elsif ($cgiparams{'ACTION'} eq $Lang::tr{'add'} && $cgiparams{'TYPE'} eq '') { - &General::readhash("${General::swroot}/vpn/settings", \%vpnsettings); &Header::showhttpheaders(); &Header::openpage($Lang::tr{'vpn configuration main'}, 1, ''); - &Header::openbigbox('100%', 'LEFT', '', ''); - &Header::openbox('100%', 'LEFT', $Lang::tr{'connection type'}); + &Header::openbigbox('100%', 'left', '', ''); + &Header::openbox('100%', 'left', $Lang::tr{'connection type'}); print <
| + | $Lang::tr{'host to net vpn'} | +
| + | $Lang::tr{'net to net vpn'} | +
| + | |
+ 







| $Lang::tr{'compression'} | \n"; - print "\n"; - if ($confighash{$cgiparams{'KEY'}}[3] eq 'net') { - print " | $Lang::tr{'nat-traversal'} | \n"; - print "\n"; - } else { - print " | $Lang::tr{'nat-traversal'} | \n"; - print "\n"; - } + &Header::openbox('100%', 'left', "$Lang::tr{'advanced'}:"); print < | $Lang::tr{'ike encryption'} | -- | $Lang::tr{'ike integrity'} | -- |
| $Lang::tr{'ike lifetime'} | -$Lang::tr{'hours'} | -$Lang::tr{'ike grouptype'} | -|
| $Lang::tr{'esp encryption'} | -- | $Lang::tr{'esp integrity'} | -|
| $Lang::tr{'esp keylife'} | -$Lang::tr{'hours'} | -$Lang::tr{'esp grouptype'} | -|
| - $Lang::tr{'use only proposed settings'} | |||
| $Lang::tr{'ike encryption'} | + | + +$Lang::tr{'ike integrity'} | + | + +$Lang::tr{'ike grouptype'} | + | +
| $Lang::tr{'ike lifetime'} | + $Lang::tr{'hours'} | + +||||
| $Lang::tr{'esp encryption'} | + | + +$Lang::tr{'esp integrity'} | + | + +$Lang::tr{'esp grouptype'} | + | +
| $Lang::tr{'esp keylife'} | + $Lang::tr{'hours'} | +||||
| + IKE+ESP: $Lang::tr{'use only proposed settings'} | +|||||
| + $Lang::tr{'vpn aggrmode'} | +|||||
| + $Lang::tr{'pfs yes no'} | ++ | ||||
| + $Lang::tr{'vpn payload compression'} | ++ | ||||
| "; + print " $Lang::tr{'vpn vhost'} | |||||
| "; + print " $Lang::tr{'vpn vhost'} | |||||
| $Lang::tr{'local vpn hostname/ip'}: | -- | $Lang::tr{'enabled'} | +$Lang::tr{'local vpn hostname/ip'}: | ++ | $Lang::tr{'enabled'} | +$Lang::tr{'vpn on green'}: | +$Lang::tr{'enabled'} | +$Lang::tr{'enabled'} | +END + ;} + + print <$Lang::tr{'override mtu'}: ![]() |
+ + | + $checkbox END ; if ($netsettings{'BLUE_DEV'} ne '') { - print < | $Lang::tr{'vpn on blue'}: | -- | $Lang::tr{'enabled'} | - + $checkbox=<$Lang::tr{'enabled'} | END - ; - } + ;} print <- | $Lang::tr{'override mtu'}: ![]() |
- - |
| PLUTO DEBUG | -crypt: | -parsing: | -emitting: | -control: | -klips: | -dns: | -nat_t: | -


$Lang::tr{'vpn watch'}:
+PLUTO DEBUG = +crypt:, +parsing:, +emitting:, +control:, +klips:, +dns:, +nat_t:
+![]() |
- $Lang::tr{'vpn delayed start help'} | +$Lang::tr{'this field may be blank'} | +
![]() |
+ $Lang::tr{'vpn delayed start help'} |


| $Lang::tr{'ca name'}: | ++ | + | + |
| $Lang::tr{'resetting the vpn configuration will remove the root ca, the host certificate and all certificate based connections'}: | +|||
| $Lang::tr{'ca name'}: | -- | - | - |