Repository navigation
network: keep every trusted openconnect pin for multi-node gateways - #4201
Merged
bbedward merged 1 commit intoNov 8, 2026
Merged
Conversation
Member
|
/claude review |
Contributor
Claude reviewNo issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fortinet password profiles (openconnect,
authtype=password) keep asking the user to trust the server certificate on every connect when the gateway is a FortiGate HA cluster.Why it happens. An HA pair behind one address answers each TLS connection from either node, and each node presents its own factory certificate (
CN=<serial>, issued byfortinet-subca2001, so it never matches the hostname and has to be pinned). Against our gateway, 20 handshakes split 11/9 between the two nodes with no fixed order.handleOpenConnectPasswordAuthstores a single pin incertificate:<gateway>, and trusting a new certificate overwrites it. Trusting node B forgets node A, so the next connection that lands on A shows "The server certificate has changed" again, and so on.What this changes.
certificate:<gateway>now holds a comma-separated list of pins. Trusting a certificate appends to the list instead of replacing it, so each node is confirmed once. This is the same approachappendTrustedCertalready takes for the Fortinet SAML path (trusted-cert, openfortivpn digests).runOpenConnectPasswordAuthpasses every trusted pin as its own--servercert=flag. openconnect accepts repeated flags and matches any of them. A single comma-joined value is treated as one pin.certDigestTrusted, which usesEqualFoldfor hex digests.server-certificate/server-certificate-changedprompt reasons are kept.gwcerthanded to NetworkManager is still the single pin of the node that answered the authentication.Known limitation, outside dux-shell. The tunnel itself is started by
nm-openconnect-service, which passes only one--servercert(thegwcertsecret). When the tunnel connection lands on the other HA node, it can still fail withNone of the 1 fingerprint(s) specified via --servercert match. This is tracked upstream in NetworkManager-openconnect#152, which proposes a;-separatedgwcertlist, and #149. Sending a list ingwcerttoday would break the stock plugin, so this PR deliberately leaves it alone. Once #152 lands, I plan to follow up with a PR that passes the full list.I use this path daily against a FortiGate HA pair, so I'm happy to keep looking after the openconnect/Fortinet password flow, including that follow-up, and to help triage related reports.
Type of change
Related issues
No existing issue in this repo. Related upstream: GNOME/NetworkManager-openconnect#152, GNOME/NetworkManager-openconnect#149.
Screenshots / video
No visual change. The existing "Untrusted VPN certificate" prompt now appears once per node instead of on every connect.
Checklist
I18n.tr()with translator context, reusing existing terms where possible (no new strings)make fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings (no QML changes)Tests:
TestOpenConnectCertificateRotationRepromptsnow expects the old pin to be kept alongside the new one.TestOpenConnectTrustedPinsForEveryNodechecks that with both pins trusted, the node that answers is accepted without a prompt and openconnect receives both--servercertflags.TestAppendServerCertPincovers dedupe, blank entries and case sensitivity. Both behavior tests fail on currentmaster.go vet ./...reports 7 errors in generated mocks (MarshalJSONsignatures), which also occur onmasterand are untouched here.