Skip to content

Apply Hermes DNS when storing refreshed macOS WireGuard config - #32

Open
chris-in-the-shell wants to merge 1 commit into
ProtonVPN:developfrom
chris-in-the-shell:fix/macos-hermes-dns-client-config
Open

Apply Hermes DNS when storing refreshed macOS WireGuard config#32
chris-in-the-shell wants to merge 1 commit into
ProtonVPN:developfrom
chris-in-the-shell:fix/macos-hermes-dns-client-config

Conversation

@chris-in-the-shell

Copy link
Copy Markdown

Summary

Apply Hermes DNS settings when macOS stores refreshed WireGuard client config during session refresh.

Background

The macOS session refresh path was storing clientConfig.wireGuardConfig directly after fetching VPN properties. That bypassed the existing refreshConfig() step used by iOS and by the macOS Hermes update event path.

As a result, active Hermes/custom DNS resolvers could be missing from the stored WireGuard config until a later Hermes update event refreshed it.

Changes

  • In apps/macos/ProtonVPN/Scenes/Common/Services/AppSessionManager.swift, update the macOS session refresh path to store clientConfig.wireGuardConfig.refreshConfig() instead of the raw clientConfig.wireGuardConfig
  • This aligns the macOS retrieveProperties() behavior with the existing iOS session refresh path and the macOS Hermes update event path
  • In apps/macos/ProtonVPNTests/Tests/AppSessionManagerImplementationTests.swift, add AppSessionManagerHermesDNSTests to cover the silent login/session refresh behavior

Verification

The new regression tests are included in this PR and exercise the session refresh behavior with mocked app dependencies:

  • auth and VPN keychains are populated with test credentials
  • vpnApiClient.vpnProperties returns ClientConfig.defaultClientConfigForTests
  • Hermes is configured with an active custom resolver, 127.0.0.1
  • attemptSilentLogIn() is run
  • the stored propertiesManager.wireguardConfig.dnsServers value is asserted

Covered scenarios:

  • Hermes enabled and authorized: stores ["127.0.0.1", "10.2.0.1"]
  • Hermes disabled: stores ["10.2.0.1"]
  • Hermes enabled but not authorized: stores ["10.2.0.1"]

Testing

  • git diff --check
  • Targeted macOS regression test: AppSessionManagerHermesDNSTests

I verified the targeted test locally in a configured macOS/Xcode project environment.

The test is included in this PR and can be run from the PR branch with:

xcodebuild test \
  -workspace ProtonVPN.xcworkspace \
  -scheme ProtonVPNmacOSTests \
  -destination 'platform=macOS' \
  -only-testing:ProtonVPNmacOSTests/AppSessionManagerHermesDNSTests

Manual signed-app VPN tunnel verification was not run.

@chris-in-the-shell
chris-in-the-shell marked this pull request as ready for review July 1, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant