Révision 2da48592
Ajouté par jim-p il y a presque 10 ans
usr/local/www/vpn_openvpn_client.php | ||
---|---|---|
244 | 244 |
|
245 | 245 |
/* If we are not in shared key mode, then we need the CA/Cert. */ |
246 | 246 |
if ($pconfig['mode'] != "p2p_shared_key") { |
247 |
$reqdfields = explode(" ", "caref certref");
|
|
248 |
$reqdfieldsn = array(gettext("Certificate Authority"),gettext("Certificate"));
|
|
247 |
$reqdfields = explode(" ", "caref"); |
|
248 |
$reqdfieldsn = array(gettext("Certificate Authority")); |
|
249 | 249 |
} elseif (!$pconfig['autokey_enable']) { |
250 | 250 |
/* We only need the shared key filled in if we are in shared key mode and autokey is not selected. */ |
251 | 251 |
$reqdfields = array('shared_key'); |
... | ... | |
253 | 253 |
} |
254 | 254 |
|
255 | 255 |
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); |
256 |
|
|
256 |
|
|
257 |
if (($pconfig['mode'] != "p2p_shared_key") && empty($pconfig['certref']) && empty($pconfig['auth_user']) && empty($pconfig['auth_pass'])) { |
|
258 |
$input_errors[] = gettext("If no Client Certificate is selected, a username and password must be entered."); |
|
259 |
} |
|
260 |
|
|
257 | 261 |
if (!$input_errors) { |
258 | 262 |
|
259 | 263 |
$client = array(); |
... | ... | |
733 | 737 |
<tr id="tls_cert"> |
734 | 738 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Client Certificate"); ?></td> |
735 | 739 |
<td width="78%" class="vtable"> |
736 |
<?php if (count($a_cert)): ?> |
|
737 | 740 |
<select name='certref' class="formselect"> |
738 | 741 |
<?php |
739 | 742 |
foreach ($a_cert as $cert): |
... | ... | |
753 | 756 |
?> |
754 | 757 |
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['descr'] . $caname . $inuse . $revoked;?></option> |
755 | 758 |
<?php endforeach; ?> |
759 |
<option value="" <?PHP if (empty($pconfig['certref'])) echo "selected=\"selected\""; ?>>None (Username and Password required)</option> |
|
756 | 760 |
</select> |
757 |
<?php else: ?>
|
|
758 |
<b>No Certificates defined.</b> <br />Create one under <a href="system_certmanager.php">System > Cert Manager</a>. |
|
761 |
<?php if (!count($a_cert)): ?>
|
|
762 |
<b>No Certificates defined.</b> <br />Create one under <a href="system_certmanager.php">System > Cert Manager</a> if one is required for this connection.
|
|
759 | 763 |
<?php endif; ?> |
760 | 764 |
</td> |
761 | 765 |
</tr> |
Formats disponibles : Unified diff
Allow the user to select "None" for OpenVPN client certificate, so long as they supply and auth user/pass. Ticket #3633