Skip to content

Commit 4e51569

Browse files
committed
op-mode: T6424: ipsec: filter out duplicate CA certificates in Apple IOS profile
1 parent d65f435 commit 4e51569

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/op_mode/ikev2_profile_generator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@
168168
}
169169
data['ca_certificates'].append(tmp)
170170

171+
# Remove duplicate list entries for CA certificates, as they are added by their common name
172+
# https://stackoverflow.com/a/9427216
173+
data['ca_certificates'] = [dict(t) for t in {tuple(d.items()) for d in data['ca_certificates']}]
174+
171175
esp_proposals = conf.get_config_dict(ipsec_base + ['esp-group', data['esp_group'], 'proposal'],
172176
key_mangling=('-', '_'), get_first_key=True)
173177
ike_proposal = conf.get_config_dict(ipsec_base + ['ike-group', data['ike_group'], 'proposal'],

0 commit comments

Comments
 (0)