mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-14 02:22:03 +08:00
added new authentication mode optional-certificate
That mode allows having only specific group of users that are required to present a certificate.
This commit is contained in:
+3
-1
@@ -389,6 +389,8 @@ unsigned force_cert_auth;
|
||||
config->auth_types |= AUTH_TYPE_PLAIN;
|
||||
} else if (c_strcasecmp(auth[j], "certificate") == 0) {
|
||||
config->auth_types |= AUTH_TYPE_CERTIFICATE;
|
||||
} else if (c_strcasecmp(auth[j], "optional-certificate") == 0) {
|
||||
config->auth_types |= AUTH_TYPE_CERTIFICATE_OPT;
|
||||
} else {
|
||||
fprintf(stderr, "Unknown auth method: %s\n", auth[j]);
|
||||
exit(1);
|
||||
@@ -652,7 +654,7 @@ static void check_cfg(struct cfg_st *config)
|
||||
}
|
||||
|
||||
if (config->auth_types & AUTH_TYPE_CERTIFICATE) {
|
||||
if (config->cisco_client_compat == 0)
|
||||
if (config->cisco_client_compat == 0 && ((config->auth_types & AUTH_TYPE_CERTIFICATE_OPT) != AUTH_TYPE_CERTIFICATE_OPT))
|
||||
config->cert_req = GNUTLS_CERT_REQUIRE;
|
||||
else
|
||||
config->cert_req = GNUTLS_CERT_REQUEST;
|
||||
|
||||
Reference in New Issue
Block a user