Repository navigation
Conversation
When the server sends a bare RESTART (without the [P] flag), the OpenVPN 3 client currently purges its session ID (auth-token) while retaining the cached username and password. OpenVPN 2.x handles this differently: it clears the cached username and password but keeps the auth-token. This difference causes OpenVPN 3 clients connected to an OpenVPN 2.x server using --explicit-exit-notify and --auth-gen-token to require interactive authentication (for example, SSO) after a server restart triggered by SIGUSR1, while OpenVPN 2.x clients reconnect using their existing auth-token. Align OpenVPN 3 with the OpenVPN 2.x behaviour: on RESTART without [P], clear the cached username and password while preserving the session ID. HALT handling remains unchanged. If the token is no longer valid, it is cleared through the existing AUTH_FAILED handling. Reported-at: OpenVPN/openvpn#1099 Signed-off-by: Kirthik Aditya <kirthikaditya@gmail.com>
This branch has not been deployed
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.
Fixes the OpenVPN 3 side of OpenVPN/openvpn#1099, where it was agreed that the client difference should be fixed in OpenVPN 3 rather than worked around in the 2.x server.
Problem
On a bare
RESTART(without[P]),recv_halt_restart()purges the session ID (auth-token) and keeps the cached username/password. The OpenVPN 2.x client does the opposite: it purges the username/password and keeps the auth-token. As a result, OpenVPN 3 clients connected to a 2.x server with--explicit-exit-notify+--auth-gen-tokenhave to re-authenticate interactively (e.g. SSO) after a server SIGUSR1, while 2.x clients reconnect with their token.Change
On
RESTARTwithout[P], purge the username/password and keep the session ID, matching 2.x.HALTis unchanged. If the token is no longer valid, the existing AUTH_FAILED handling purges it (tested: full server restart withoutauth-gen-token-secretends inSESSION_EXPIRED, so the user is asked to log in again).Testing
ovpncliagainst an unmodified 2.x server (explicit-exit-notify 1+auth-gen-token, SIGUSR1):Before:
After:
ctest: 36/36 passed (6 DCO tests skipped, no ovpn-dco module in WSL).git clang-format: no changes.Open questions (draft until answered)
RESTARTmaking the client drop its session ID (as opposed toRESTART,[P]:)? If so, this change would affect them.recv_halt_restart()is also called internally when the client rejects a pushed option ("RESTART,rejected pushed option: ..."). With this change the token is kept in that case too. Is that acceptable?Once these are settled I'll send the patch to openvpn-devel as
[PATCH OpenVPN3].