mirror of
https://github.com/amnezia-vpn/amneziawg-apple.git
synced 2026-12-03 18:31:54 +07:00
[PR #52] feat: support opt-in DNS SRV endpoint discovery #52
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-apple#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/amnezia-vpn/amneziawg-apple/pull/52
Author: @cubatic45
Created: 11/1/2026
Status: 🔄 Open
Base:
master← Head:feat/dns-srv-endpoints📝 Commits (4)
ec0a2fcAdd opt-in DNS SRV endpoint discovery and refresh6eceb25Use the DNS-SD error constant with its imported Swift typef665aafScope resolver tests and add an opt-in live DNS-SD smoke teste7063bcHighlight SRV URLs as service names rather than fixed ports📊 Changes
13 files changed (+625 additions, -3 deletions)
View changed files
➕
.github/workflows/srv-tests.yml(+38 -0)📝
README.md(+45 -0)➕
Scripts/test-srv-highlighter.c(+28 -0)➕
Scripts/test-srv.py(+26 -0)📝
Sources/WireGuardApp/Localizable.xcstrings(+1 -1)📝
Sources/WireGuardApp/UI/macOS/View/highlighter.c(+28 -0)📝
Sources/WireGuardKit/DNSResolver.swift(+28 -1)📝
Sources/WireGuardKit/Endpoint.swift(+30 -1)📝
Sources/WireGuardKit/PacketTunnelSettingsGenerator.swift(+33 -0)➕
Sources/WireGuardKit/SRVResolver.swift(+129 -0)📝
Sources/WireGuardKit/WireGuardAdapter.swift(+39 -0)➕
Tests/WireGuardKitTests/SRVEndpointTests.swift(+194 -0)📝
WireGuard.xcodeproj/project.pbxproj(+6 -0)📄 Description
Problem
NAT traversal tools can publish a changing public UDP port through DNS SRV, but the Apple client currently resolves only the address portion of a fixed
host:portendpoint. An updated A/AAAA record cannot communicate a changed port, so users must edit the peer configuration when that port changes.Behavior
Add explicit, opt-in SRV discovery in peer configurations:
For example:
The client discovers the target and UDP port, then uses the existing address resolver. Existing
hostname:port, IPv4 and bracketed IPv6 endpoints retain their fixed-port behavior. Configuration export preserves the SRV URL; only a resolved numeric endpoint is sent to the backend.The implementation:
.) as unavailable. It validates the uncompressed SRV RDATA and rejects malformed or ambiguous endpoint URLs.This is an Apple-client configuration extension, not a change to the WireGuard wire protocol or to stock
wg-quick. The configured peer public key remains unchanged. DNS must be reachable before connection and during refresh; a DNS server accessible only through a broken tunnel cannot bootstrap discovery. Address-lookup failover is covered; handshake-based target failover is outside this change.Validation
_sip._udp.sip.linphone.org; it queried SRV through the system resolver and resolved the discovered target and port. Normal CI skips this network-dependent test unless a record name is supplied throughworkflow_dispatch.The focused test runner avoids linking the Go backend, so tests do not require Go build artifacts or signing credentials. An initial run of the existing complete test suite also exposed an unrelated failure in
HandshakeFreshnessEvaluatorTests.testLatestHandshakeOlderThanCutoffIsNotFresh: the existing implementation ignorescutoffDate, while that test expects it to be enforced. Those upstream files are unchanged; the added workflow runs the focused SRV suite rather than changing handshake semantics in this PR.CI with the live system-resolver test: https://github.com/cubatic45/amneziawg-apple/actions/runs/41274693303
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.