On this page
A configuration can pass validation and requests can reach the proxy, yet authentication may still stall at the handshake. Keep the original server and authentication settings while checking the exact failure in the logs. Connecting after removing an authentication parameter tests different conditions; it does not prove the original configuration was fixed.
Why Does OpenVPN tls-auth Handshaking Time Out with Non-SHA1 auth?
With configuration loading, DNS, and the PROCESS-NAME rule working, check whether the control channel times out after 4 retransmissions, and save the log make OpenVPN handshake: read hard reset response after 4 retransmits: context deadline exceeded.
Mihomo issue #2992 documents a very narrow combination: an OpenVPN outbound uses tls-auth while auth is set to SHA512.
The reported environment was Windows 11 with Mihomo v1.19.29. HTTP requests could return 502, while HTTPS stopped receiving TLS data after the proxy accepted CONNECT. In the same Mihomo environment, another OpenVPN configuration without tls-auth worked.
This comparison supports checking tls-auth and auth before blaming DNS, routing, or the entire proxy entry point.
PR #3189 confirms that the old implementation fixed the HMAC digest for tls-auth control packets to SHA1. If the server validates them with another auth digest such as SHA256, SHA384, or SHA512, it discards the first control packet because the tag length differs.
If you can read the server log, you may see TLS Error: cannot locate HMAC in incoming packet. Servers using SHA1 are not affected by this specific defect, and ordinary TLS, certificate, port, or network errors are outside this guide's conclusion.
Check tls-auth, auth, and key-direction using a redacted copy
Create a separate troubleshooting copy of the configuration instead of editing the live file. Confirm that the proxy is type: openvpn, then record auth, whether tls-auth is present, key-direction, proto, the port, and the server domain.
The official documentation states that tls-auth is mutually exclusive with tls-crypt and tls-crypt-v2. With tls-auth, key-direction supports 0 or 1. auth supports MD5, SHA1, SHA256, SHA384, and SHA512, with SHA256 as the default.
Do not post the tls-auth static key, username, password, client private key, full certificate contents, or real server address in a public issue. Public evidence should contain only field names, the digest algorithm, a redacted address, the error time, and the first relevant log line. Keep the original configuration private.
Do not remove tls-auth, guess key-direction, or reduce server auth to SHA1 for testing. These changes alter the original authentication method; even if the connection returns, you cannot tell whether upgrading fixed the original problem.
mihomo -v
mihomo -t -f /path/to/config.yamlBefore Handshaking, Are Resolution, Rules, and Ports Working?
A handshake error only means the OpenVPN control channel did not complete; it does not prove the cause by itself. First confirm that the server domain resolves, the target UDP or TCP port is reachable, the request actually matches this OpenVPN outbound, and a known-good outbound remains available for comparison.
If the log already shows an earlier error during resolution, dialing, certificate loading, or configuration validation, address that error first. The diagnostic sequence in issue #2992 applies only when DNS and routing both succeed, the connection reaches the OpenVPN handshake, and a hard reset timeout appears after 4 retransmissions.
Use the same server, the same redacted configuration, and the same HTTPS target before and after the upgrade. If you also change the node, protocol, port, certificate, and auth during testing, a recovered connection cannot be attributed to v1.19.31.
The configuration test fails or a field is unsupported
Fix the YAML and field compatibility issues in the current version first. Until they are resolved, do not treat this as a handshake problem.
The server domain does not resolve
Check DNS, proxy-server-nameserver, and the system network first.
The rule does not match the OpenVPN outbound
Pin the test policy and confirm the actual outbound in Connections or the log.
The port is immediately refused or remains unreachable
Check the server, port, firewall, and proto; do not label it an HMAC digest problem.
The connection reaches the handshake, then shows 4 retransmits, and the field combination also matches
Save the current error and configuration records, then compare with v1.19.31.
Save Rollback Copies and Upgrade the Official Core
v1.19.31 is the stable release that includes the PR #3189 fix. Before upgrading, record the current binary's full version output, operating system, CPU architecture, managing client or service manager, and the core file's actual location.
Make a complete private backup of the configuration, referenced certificate files, and old core binary. If you use a graphical client, also record its core-update entry point and automatic-update policy; the application version and the running Mihomo version are not always the same.
For a remote device, router, or unattended host, first confirm that there is a management route that does not use this OpenVPN outbound. Without backup access, do not replace the core directly through your only remote connection.
Mihomo v1.19.31 was released on 2026-9-14. The Release explicitly includes commit 6d179a1c, which makes the HMAC digest used by OpenVPN tls-auth follow auth instead of remaining fixed to SHA1.
The minimum target is to actually run v1.19.31. If you use a later stable release, confirm that it includes the 6d179a1c fix. Updating only the graphical client interface or subscription does not upgrade the core.
If you run Mihomo directly, choose the asset from the official MetaCubeX/mihomo v1.19.31 Release that matches your operating system, CPU architecture, and build variant, then verify the SHA256 listed for that asset on the Release page.
If Clash Verge Rev, OpenClash, or another frontend manages the core, use that project's official core-update entry point and read the actual running version again afterward.
Stop the old core before replacing the file, and preserve its permissions, startup arguments, and service configuration. Do not mix individual files from different versions, and do not obtain a same-named core from search ads, file-sharing services, or unknown mirrors.
Confirm that v1.19.31 can load the original configuration, then start the service and inspect the first log entry.
Verify the fix with the same OpenVPN Profile
After upgrading, the decisive result is not a success message in the interface but whether the same server, same Profile, same auth, and same tls-auth complete the control-channel handshake. First pin the policy-group selection so a request clearly uses the target OpenVPN outbound, then visit the same HTTPS target used before the upgrade.
Confirm that the log no longer contains read hard reset response after 4 retransmits and that the request receives a real HTTPS response. Also test an ordinary outbound to ensure the core upgrade did not break other paths. If you need UDP, perform a separate real UDP workload test; a latency number is not a substitute.
Do not count a successful test after disabling tls-auth, changing auth to SHA1, or switching to another server as verification of the fix. Those changes only prove that a different configuration works; they do not prove that v1.19.31 fixed the original combination.
curl -I -x http://127.0.0.1:7890 https://example.comv1.19.31 fix acceptance checklist
- The actual running version is v1.19.31, or a later stable release confirmed to include the fix
- The configuration, server, auth, tls-auth, and key-direction were not changed for the test
- The test request actually uses the target OpenVPN outbound
- The log no longer shows the hard reset handshake timeout after 4 retransmits
- The same HTTPS target returns a valid response rather than merely accepting a connection to the local proxy port
- Ordinary outbounds and basic networking still work; if UDP is needed, a separate real UDP test has been completed
- The old core, private configuration backup, and rollback procedure remain available
Handshake still fails on v1.19.31: check keys, certificates, and the first error
If the actual running version is v1.19.31 or a later stable release confirmed to include the fix, but the handshake still fails, do not keep attributing every error to the old fixed-SHA1 behavior. First compare whether the error is still identical, whether the request still uses the same outbound, and whether the server also reports an HMAC, certificate, key-direction, or authentication failure.
Recheck ca, cert, key, tls-auth, key-direction, auth, proto, the port, and the system time. Confirm that tls-auth is not combined with tls-crypt or tls-crypt-v2. If the server configuration or keys changed recently, use the server's current configuration rather than guessing from an old client file.
Only continue troubleshooting from a new first error if the original error disappears and is replaced by a different, explicit error. Repeatedly changing the digest, key-direction, and certificate breaks the version comparison and may trigger the server's failure protections.
The version still reports v1.19.30 or earlier
Fix the core-update path; the current process is not yet using a version that contains the fix.
The rule sends traffic through DIRECT or another proxy
Restore an explicit test policy; do not judge the OpenVPN result through the wrong outbound.
The server reports incoming packet authentication failed
Check the tls-auth key and key-direction; do not regenerate or disclose the key.
A certificate, private-key, or CA error appears
Switch to certificate-chain and client-identity troubleshooting; the HMAC root cause in this guide no longer applies.
The same 4 retransmits remains, and both the fields and version match
Save the minimal redacted configuration, the first relevant log from both ends, and the version, then submit reproducible evidence to the Mihomo project.
Roll back if the upgrade causes problems, but do not weaken authentication
If v1.19.31 introduces another startup or compatibility problem on this device, stop the new core, restore the complete old binary and original configuration saved before the upgrade, and start it through the same management entry point. After rollback, first confirm the version and configuration load, then test an ordinary outbound and the device-management path.
The old core reintroduces the non-SHA1 tls-auth handshake problem described here, so it is not a long-term fix for this OpenVPN Profile. If service must be restored immediately, switch to another verified node or protocol, or temporarily disable this Profile. Do not delete tls-auth, guess key-direction, or lower the server's auth to accommodate the old client.
When upgrading again, use the same redacted records, official assets, and real requests. Reports should include the system, architecture, full version output, field combination, first logs before and after upgrading, and minimal reproduction steps, without static keys, accounts, private keys, or real service addresses.
