mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-10-15 13:52:15 +00:00
[GH-ISSUE #3091] [Android 16][XRay/VLESS WS+TLS] IPv6 endpoint causes TLS handshake failure with no IPv4 fallback; config edits are discarded #1434
Open
opened 2026-10-13 20:42:24 +00:00 by bsakaguchi
·
5 comments
No Branch/Tag specified
dev
feat/api-tests
feat/otp-login
fix/show-locked-xray-settings-page-for-servers-without-write-access
fix/serialize-log-record-writes-and-pin-log-date-format-locale
fix/libagw-review-fixes
fix/ios-xray-ipv6-leak
fix/macos-xray-ipv6-leak
feat/add-support-include-split-tunnel
fix/win-xray-app-split-tunneling
fix/bug-when-saving-after-canceling
fix/xray-reconnect-crash
fix/share-empty-config-on-ssh-timeout
fix/ssh-credentials-input
fix/updater-verify-signature
fix/async-ssh-threading
fix/xray-check-inet-and-liveness-monitor
fix/selfhosted-server-installations
feat/add-support-ikev2-macos
fix/icons-different-color-themes
feat/add_support_arm_windows
feat/add-deep-link
feat/fixed-push-notifications-on-VPN-connect-disconnect-2
feat/implement-QR-code-generation-and-scanning
feat/file-password-protection
feature/add-local-proxy
feat/add-support-split-tunnel-macos
feat/tests
fix/android-register-unacknowledged-purchase
fix/share_on_linux
mirroring-to-outside
feat_copy_docker_configs
feat/self-diagnostics-log
feat/amnezia-free-vless-switch
fix/conan_build_android_on_win
fix/linux-reconnect-dns-reliability
fix/windows-connection-stability
fix/linux-reconnect-refactoring
fix/ios-groupidentifier-order
feat/xray-subscription-link
fix/minor-fixes
fix/xray-config-inplace-edit
feat/amnezia-sdk-typed-api
feat/amnezia-sdk-integration
feat/force-update-native
refactor/marketplace-update-popup
feat/force-update
fix/valnurability_dev
chore-xcode-version
fix/empty-i1-i5
build_qt_6_10_1
master
feat/protocol-selection
fix/openvpn_install
feat/locations_change
feat/locations_change_rework
feature/local-proxy-integration
fix/filepicker_atv
fix_valnurability
fix/macos-ne-codesign-4.8.19.0
temp-branch-for-testing
fix/rebased_4_8_19_linux_fix_error
feat/proxy-storage-cache
fix/zeroed-params
fix/killswitch-blocknets-linux
update/translation_RU
fix/self_hosted_reinstall_error
feat/selfhosted-dns
fix/agp_version_up
feat/switch_to_alive_protocol
feat/support_multipeer
server_scripts_update
fix/extended-vless-configuration
chore/apple-ci-cd-macos-versions
feat/add-telemt
fix/android_keystore_read_error
feat/add-mtproxy
chore/bump-qt-version
fix/make_dbus_async
feature/dns
rebase/apple-tv-target-on-conan
fix/outbound_freedom_xray_with_dns_fix
feat/apk_support
feat/fallback-proxy
feat/apple-tv-target
fix/dns_reconnection_issue
feat/fixed-push-notifications-on-VPN-connect-disconnect
fix/linux-firewall
docker-regional-locks
appstore-review-popup
feat/storekit2
fix/uninstall-split-tunnelling-driver
revert-2376-chore/license-file
support_16kb_android
bump_version
feat_add_review_android
bugfix/translation-absence-on-subscription-key-page
feat/location-separation-by-region
bugfix/text-moving-when-resing-window
fix_backup
feature/add-purchase-android
bugfix/moved-text-while-resizing-window
bugfix/incorrect-killswitch-restore-from-backup
fix/backup-exclude-secondary-api-configs
feat/proxy-fields-for-dev-console
bugfix/ovpn-ios-fix
bugfix/linux-bundle-libraries
fix/xray-app-split-win
fix/upload-to-s3
chore/add-release-date-upload
feat_add_webview_support
feature/configuration-transfer-through-qr
feat/bot-key-unlink-device
fix/ad-link-lang-support
fix/qsecuresettings-with-android
feat/add-support-arm64-win
spanish-translations
fix/context-menu
feat/add-system-dns-support
fix/qt6-9-support
fix/qt6_9_support
bugfix/strict-killswitch-ui
android-7
chore/minor-bugfixes
feature/awg-net-fix-macos-wakeup
fixbug/ios18
bugfix/ios-ne-crash
fix/linux-tray-quit-button
cryptpad-support
bugfix/disable-linux-killswitch
fix/minor-ui-fixes
feature/setup-guid-tun2socks
feature/linux-ipsec
feature/ipsec-linux
refactoring/server-config-in-classes
feature/macos-ipsec
fix/ui-fixes-after-merge-with-d20ed4a
chore/focus_control_after_qt_6.9_migration
feature/integrate-xray-as-a-library
maxos-awg-fix
feature/add-new-awg-docker-image
chore/update-3rd-prebuild
feature/test-news
fix/api-conf-files
bugfix/split-tunneling-with-api-config
bugfix/ios-awg-new-fields
feature/special-handshake-2
feat/xray-api-support
fix/desktop-entry
bugfix/shadowsocks-cipher-setting-not-changing
feature/update-tap
bugfix/openvpn_import_fix
feature/ability-to-change-port-after-installing-xray
bugfix/strict-mode-ovpn
bugfix/win-ipv6-ovpn
bugfix/subnet-adress-setting
exception-podman-docker
bugfix/fix-listviewtype-scrolling
bugfix/win-disabled-ipv6
bugfix/win-ipv6-disabled-ovpn
feature/killswitch-strict-mode
feature/awg-network-check
feature/empty-split-tunneling-list
feature/support-info
chore/update-go-version
checking-Linux-version
update_server_scripts
bugfix/button-selection-easy-setup-page
feature/old-api-proxy
patch/user-checking
fix/correcting-version
support-podman
support_podman
user-checking-patch
feature/check-docker-version
feature/allowed-dns-list
without_lsof
chore/error-body
Update-amneziavpn_ru_RU
shiroow-patch-8
shiroow-patch-7
shiroow-patch-6
shiroow-patch-5
shiroow-patch-4
shiroow-patch-3
shiroow-patch-2
shiroow-patch-1
check_sudo_permissions
feature/euphoria
add_next_octet_to_ip_settings
bugfix/mobile-controllers-init
euphoria
bugfix/android-crush
feature/macox-network-extension
bugfix/pre-release-hotfixes
bugfix/ipsec-pfs
chore/ios-site-links
checking_sudo_permissions
feature/android-tv
improve_navigation_cpp
bugfix/linux-firewall-install
fixbug/wireguard-handshake-time
ReadmeRu_full
feature/xray-user-management
feature/subscription-end-date
chore/clang-format
feature/ru-in-readme
chore/increased-api-timeout
chore/deploy-workflow
bugfix/services-list-scroll
wheel_group_suppor
chore/bump-xcode-version
fixbug/mac-network-extension
feature/android-gpb
feature/page-home-drawer-country-selection
checking-sudo-users
bugfix/service-info-from-response
fixbug/build-macos-ne-2
android-qt-6.7.3
fixbug/build-macos-ne
bugfix/wg-windows-log-folder
feature/psk-key-api-request
bugfix/user-management-qml-warnings
fix/macos-network-extension
fixbug/macos-NE-build
bugfix/fixed-isDevEnv-initialization
bugfix/revert-ios-ovpn
feature/tun2socksSrv
fix/disable_singleapp
feature/awg-wg-name-resolving
feature/disable-dhcp
bugfix/allowed-ips-old-configs
feature/goodbyedpi
feature/add-exception-log
refactoring/remove-ipv6-from-default-routes
refactoring/singleapplication-submodule
macos-dirty-build
test/gateway
Update-amneziavpn_fa_IR.ts
bugfix/ipsec-win
fix/xray-custom-port
improve-tab-navigation
test-win-11
feature/android-tv-remote-control-support
KsZnak-patch-1
feature/awg-wg-qr
bugfix/fix-loopback-splittunel
fix/setup_host_firewall
feature/android-xray
feature/openvpn-pass
feature/connection-string
fix/clickable-errors
bugfix/api_1100_fix
feature/graphview
testsvg
feature/update-win-awg
feature/open-as-amnezia
feature/update-mozilla-upstream
bugfix/qr-code-cutting
feature/native-wg-psk
test/awg-centos
bugfix/hide_error
feature/add-uninstaller-checkbox
bugfix/cancel-button-on-install-page
bugfix/anchors-page-home-warning
awg-udptlspipe
button-focus-fix
revert-677-fix/logger
bugfix/Revert_PR_596
bugfix/allowed-ips-api-configs
bugfix/on-escape-pressed
feature/auto-scroll-for-server-selection-list
fix/ui-fixes
translations/update_fa_IR.ts
feature/new-awg-docker-container
bugfix/awg_ipv6_fix
feature/tab-navigation
fix/username-no-autocapitalization
sure
refactoring/servers-model-cleanup
feature/wg-mtu-setup-ios
3rd_adaptation_to_diff_OS
sudo_not_found
test/docker-ce
bugfix/double_clear_server_from_amnezia
fix/android
client/3rd-prebuilt
revert-559-KsZnak-translation-ru-ex
KsZnak-translation-ru-ex
KsZnak-br1
KsZnak-text-change
feature/api-awg
feature/error-code-output
feature/win_x32_builds
text/debug-output
feature/ovpn3-desktop-cli
bugfix/secureqsettings-deadlock
refactoring/change-settings-when-connected
files_check
ArchLinux-support
second_adaptation_to_diff_os
sudo
refactoring/android-build
adaptation_to_different_os
feature/online_installer_for_v4
update_to_r2
bugfix/return-after-installation
feature/custom_drawer_component
bugfix/split-tunneling
bugfix/existing-awg-container
revert-370-feature/custom_drawer_component
bugfix/adapted_awg_questiondrawer
bugfix/updated_drawer_height_pageserverdata
bugfix/translated_new_source_strings_to_chinese
feature/split-tunneling-config
feature/accessibility-support
branch_connectivity_change_fix
feature/ikev2_android
android_ss_transport
bugfix/macos_fixes
feature/nextcloud-support
feature/macos_network_extension
android_pt_transport_source
feature/ios-openvpn3-pluggable-transport-Cloak
bugfix/cloak_for_desktops_fix
arm-build-macos
fix-macos-build-brew
bugfix/ios-build-openvpnadapter-from-source
feature/download-native-wireguard-config-on-connect
feature/v2ray-container
bugfix/dpkg-busy-checking-stuck
feature/online-installer
dev-killswitch
dev-netadapters
5.0.3.0
5.0.2.1
5.0.2.0
5.0.1.5
5.0.0.5
5.0.0.2
4.8.21.0
4.8.19.0
4.8.18.0
4.8.17.0
4.8.16.0
4.8.15.4
4.8.15.0
4.8.14.5
4.8.14.1
4.8.12.9
4.8.12.8
4.8.12.7
4.8.12.6
4.8.11.4
4.8.11.3
4.8.11.2
4.8.11.1
4.8.11.0
4.8.10.0
4.8.9.2
4.8.9.1
4.8.9.0
4.8.8.3
4.8.8.2
4.8.8.1
4.8.7.2
4.8.7.1
4.8.7.0
4.8.6.0
4.8.5.0
4.8.4.5
4.8.4.4
4.8.4.3
4.8.4.2
4.8.4.1
4.8.4.0
4.8.3.2
4.8.3.1
4.8.2.3
4.8.1.9
4.8.1.0
4.8.0.5
4.7.0.0
4.6.0.3
4.6.0.1
4.5.3.0
4.5.0.0
4.4.0.0
4.3.0.0
4.2.1.0
4.2.0.1
4.1.2.0_cloak_pt_experimental
4.1.0.1
4.0.8
3.1.0
3.0.8
3.0.7
3.0.5
2.1.2
2.1.0
2.0.10
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.1
2.0
1.9.1
1.9
1.8
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0
No labels
pull-request
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amnezia-client#1434
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?
Originally created by @MaratGaZa on GitHub (Aug 29, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3091
Describe the bug
AmneziaVPN reports
Connectedfor an imported VLESS WebSocket + TLS profile,but no traffic passes.
The endpoint domain is proxied by Cloudflare and has both A and AAAA records.
AmneziaVPN selects an IPv6 address. The bundled Xray core repeatedly reports:
The connection does not reach the server-side VLESS/Xray service. The same
original VLESS profile works in Hiddify and Happ on the same Android device and
network. It also works from Hiddify on macOS.
Steps to reproduce
AAAA records.
type=ws,security=tls, a validsni, WebSockethost, path, UUID andport 443.
Connected, but Internet access is absent.Actual behavior
Connectedbefore the outbound TLS session succeeds.remote error: tls: handshake failure.Confirmed workaround
A new VLESS URI was imported with a numeric Cloudflare IPv4 address in the
endpoint position. The original domain was retained in TLS SNI/serverName and
the WebSocket Host header. Traffic started working immediately.
Conceptual difference:
No server-side change was required.
Configuration persistence problem
As a diagnostic attempt, the following was added to
streamSettings:The editor initially displayed the modified JSON, but after the first
connection attempt the settings returned to their defaults. The runtime log
still showed the IPv6 endpoint. There is no warning that the field is not
persisted or applied.
This appears related to, but is not identical to, #2958. That report concerns
regeneration of a managed server configuration. This case concerns an imported
client VLESS profile and its native Xray configuration on Android.
Expected behavior
Connectedsolely because the Android VPN interface started.fields as transient/read-only.
Environment
7d4f3e0Log files
Attach
AmneziaVPN-public-sanitized.logfrom this draft package. It containsonly the minimal connection sequence and has no VPN UUID, domain, VPS address,
profile identifier, authentication keys or user public IP.
Related issues
AmneziaVPN-public-sanitized.log
@Vitalik93 commented on GitHub (Aug 29, 2026):
Может с этим связано? https://habr.com/ru/articles/1075272/
@MaratGaZa commented on GitHub (Aug 31, 2026):
Возможно, но такое поведение с AmneziaVPN у меня уже давно наблюдается и внутрение ошибки все равно остаются. Не сохраняется конфигурация в програме при ее изменении, не переключается на IPv4, не сообщать
Connectedесли нет реальной связи, а только запустился интейфес VPN@HeisLuka commented on GitHub (Sep 9, 2026):
I checked this against both the exact
5.0.1.5source from the report and currentdev.I think this report is source-confirmed, and there are actually several independent bugs here.
The most important one also explains the reported numeric-IPv4 workaround very closely.
1. Android pre-resolution can rewrite the TLS SNI and WebSocket Host, not only the endpoint
The VLESS importer correctly treats these as separate semantic fields.
For a typical Cloudflare WS + TLS URI it can produce approximately:
ImportController::extractXrayConfig()then also extracts the outboundaddressand promotes it to the profile-levelhostName.On Android,
Xray.startVpn()currently does:The important part is:
This is not a structured replacement of:
It replaces every textual occurrence of the hostname in the entire XRay JSON.
So if the endpoint domain, TLS SNI and WebSocket Host are the same, which is a normal Cloudflare configuration, this can effectively turn:
into:
That destroys the separation between:
and:
For a CDN/proxy endpoint that distinction is critical.
This provides a direct explanation for the reported:
It also explains the workaround unusually well
The reporter changed only the transport endpoint to a numeric Cloudflare IPv4 while preserving the original domain in SNI and WebSocket Host:
In that case:
so this block does not execute:
The SNI and WebSocket Host therefore remain domains.
That is exactly the configuration which the reporter says works.
So I think the first invariant should be:
Pre-resolving a connection endpoint must never rewrite SNI, HTTP Host, XHTTP host, or unrelated occurrences of the same string.
2. The same code also removes normal address fallback
Current Android utility code defines:
So Amnezia asks the system resolver for one address.
If that happens to be an IPv6 address:
the client then hardcodes that address into the XRay JSON.
At that point XRay no longer receives:
as the transport endpoint.
It receives:
Therefore XRay cannot subsequently resolve the hostname and try an IPv4 candidate.
The effective behavior is:
I would avoid fixing this with a hardcoded
UseIPv4unless IPv4-only behavior is explicitly selected by the user.A stronger design is:
For example:
with
Autoable to try another candidate after a failed connection.If client-side pre-resolution is necessary, it should modify only the actual dial target structurally.
3.
Connectedcurrently means local XRay stack started, not remote XRay connection succeededAfter constructing the VPN and starting the local components, Android does:
Inside
start()the code verifies that it can:but there is no successful remote VLESS/TLS connection requirement before:
is emitted.
So this sequence is currently valid:
which is exactly the symptom in this report.
The important state invariant should be:
Even if the UI ultimately keeps a single user-facing state, remote health should be observable separately so a completely unreachable VLESS endpoint is not indistinguishable from a working tunnel.
4. The raw configuration UI currently looks editable but does not save edits
The reported:
disappearing is independently explainable by current UI code.
PageProtocolRaw.qmldisplays the native configuration using a normal editable:but I cannot find any:
or:
attached to that editor.
So the current behavior is effectively:
This explains why an edit can appear to have been accepted and then disappear after a connection attempt/navigation.
Importantly, the underlying XRay model itself can preserve arbitrary native JSON.
XrayClientConfigstores the whole native configuration string in:and its
toJson()/fromJson()paths preserve that string.So this does not appear to require converting every XRay option into a structured Amnezia setting just to persist it.
There are two valid UI contracts:
The current third state:
should be avoided.
5. There is also an adjacent IPv6 exclusion bug
Android XRay currently adds the endpoint exclusion with:
But
InetNetworkitself knows that an IPv6 host route should use/128:When
hostNameresolves to IPv6, the XRay path still explicitly forces:rather than:
So instead of excluding one IPv6 endpoint from the Android VPN, it can exclude a very large IPv6 network.
That does not appear necessary to explain the TLS failure above, so I would treat it as an adjacent routing/privacy bug.
But the invariant should clearly be:
Suggested fix boundary
I would make endpoint handling explicit rather than performing string transformation on serialized configuration:
Even better, keep:
as distinct values instead of deriving one from another by text replacement.
Regression cases
DNS returns IPv6 first.
After endpoint resolution:
SNI/Host must remain unchanged.
Expected:
rather than pinning the session permanently to the first
getByName()result.Expected:
Expected:
If editing is supported, the field must survive all those transitions and appear in the runtime config.
If editing is not supported, the viewer must be read-only.
Expected:
not
/32.So I would classify this report as confirmed on current dev.
The strongest root cause is not simply “XRay prefers IPv6”:
Android pre-resolves the endpoint to one address and performs a global textual hostname→IP replacement over the entire XRay JSON. That can simultaneously pin the connection to one IPv6 candidate and overwrite the TLS SNI / WebSocket Host that the CDN requires.
The false
Connectedstate and non-persistent raw-config editor are separate, source-confirmed bugs exposed by the same report.@MaratGaZa commented on GitHub (Sep 14, 2026):
@HeisLuka, thank you very much for this exceptionally detailed source-level analysis and for checking both version 5.0.1.5 and the current dev branch.
Your explanation of the global hostname-to-IP replacement matches my observed workaround exactly: using a numeric IPv4 endpoint while preserving the original domain in TLS SNI and the WebSocket Host immediately restored traffic.
It also clearly explains why the
UseIPv4edit disappeared and why AmneziaVPN reportedConnecteddespite the repeated outbound TLS failures.I can retest this on the same Redmi device with Android 16 and provide fresh sanitized logs when a fix or test build becomes available.
@MaratGaZa commented on GitHub (Sep 14, 2026):
I would like to try contributing a focused fix for the Android hostname-to-IP
replacement described by @HeisLuka, with regression tests that preserve TLS SNI,
WebSocket Host, and unrelated JSON values.
Is anyone already working on this? Would you welcome a PR targeting dev for
this part, leaving address fallback, route exclusions, and the raw-config UI
as separate changes?
I am new to the Qt/Android codebase and plan to use AI assistance. I will review
the patch and report exactly which build and device checks I can perform.
Do you have any contribution or AI-disclosure requirements I should follow?
I can also test your own fix on the same Redmi device running Android 16.