Skip to content

Commit fbd653e

Browse files
committed
T7635: OpenConnect Certificate Authentication
1 parent 96d74db commit fbd653e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

data/templates/ocserv/ocserv_config.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ auth = "plain[otp=/run/ocserv/users.oath]"
3030
{% else %}
3131
auth = "plain[/run/ocserv/ocpasswd]"
3232
{% endif %}
33-
{% elif "cert" in authentication.mode %}
33+
{% elif "certificate" in authentication.mode %}
3434
auth = "certificate"
35-
{% if authentication.mode.cert == "cn" %}
35+
{% if authentication.mode.certificate == "cn" %}
3636
cert-user-oid = 2.5.4.3
37-
{% elif authentication.mode.cert == "uid" %}
37+
{% elif authentication.mode.certificate == "uid" %}
3838
cert-user-oid = 0.9.2342.19200300.100.1.1
3939
{% else %}
40-
cert-user-oid = {{ authentication.mode.cert }}
40+
cert-user-oid = {{ authentication.mode.certificate }}
4141
{% endif %}
4242
{% else %}
4343
auth = "plain[/run/ocserv/ocpasswd]"

interface-definitions/vpn_openconnect.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<valueless/>
7070
</properties>
7171
</leafNode>
72-
<leafNode name="cert">
72+
<leafNode name="certificate">
7373
<properties>
7474
<help>Use certificate based authentication</help>
7575
<valueHelp>

src/conf_mode/vpn_openconnect.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ def verify(ocserv):
108108
and 'radius' in ocserv['authentication']['mode'])
109109
or
110110
('local' in ocserv['authentication']['mode']
111-
and 'cert' in ocserv['authentication']['mode'])
111+
and 'certificate' in ocserv['authentication']['mode'])
112112
or
113113
('radius' in ocserv['authentication']['mode']
114-
and 'cert' in ocserv['authentication']['mode'])
114+
and 'certificate' in ocserv['authentication']['mode'])
115115
):
116116
raise ConfigError(
117-
'OpenConnect authentication modes are mutually-exclusive. Only one of local, radius, or cert.'
117+
'OpenConnect authentication modes are mutually-exclusive. Only one of local, radius, or certificate.'
118118
)
119119
if 'radius' in ocserv['authentication']['mode']:
120120
if 'server' not in ocserv['authentication']['radius']:
@@ -208,7 +208,7 @@ def verify(ocserv):
208208
raise ConfigError('SSL certificate missing on OpenConnect config!')
209209
verify_pki_certificate(ocserv, ocserv['ssl']['certificate'])
210210

211-
if 'ca_certificate' not in ocserv['ssl'] and 'cert' in ocserv['authentication']['mode']:
211+
if 'ca_certificate' not in ocserv['ssl'] and 'certificiate' in ocserv['authentication']['mode']:
212212
raise ConfigError('CA certificate must be provided in certificate authentication mode!')
213213

214214
if 'ca_certificate' in ocserv['ssl']:

0 commit comments

Comments
 (0)