New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows OpenVPN Service fails to setup connection to domain with hyphens #363
Comments
Yeah, looks like 6cf7ce4 by @lstipakov (to fix #306) reintroduced https://community.openvpn.net/openvpn/ticket/1375 |
This was introduced in 2.6.3 (release/2.6 commit is 77a7435) |
Was able to fix it this way: diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index d1fd6def..60974208 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -333,7 +333,7 @@ do_dns_domain_wmic(bool add, const struct tuntap *tt)
}
struct argv argv = argv_new();
- argv_printf(&argv, "%s%s nicconfig where (InterfaceIndex=%ld) call SetDNSDomain %s",
+ argv_printf(&argv, "%s%s nicconfig where (InterfaceIndex=%ld) call SetDNSDomain '%s'",
get_win_sys_path(), WMIC_PATH_SUFFIX, tt->adapter_index, add ? tt->options.domain : "");
exec_command("WMIC", &argv, 1, M_WARN); I also tried to wrap Here is the log with successful connection via Windows service:
|
This is needed to support domains with hyphens. Not using double quotes here, since our code replaces them with underbars (see https://github.com/OpenVPN/openvpn/blob/master/src/openvpn/win32.c#L980). Fixes OpenVPN#363 Change-Id: Iab536922d0731635cef529b5caf542f637b8d491 Signed-off-by: Lev Stipakov <lev@openvpn.net>
Thanks for reporting it, the fix is on the list. By the way, since you are on Windows 11, any reasons not to use dco-win driver? It should be used by default if you remove |
Thank you! |
Right now it should either work or refuse to establish connection. You might have experienced some options incompatibility - like compression was pushed by server even though client didn't announce its support. This should have been fixed now. Anyway, feel free to open an issue here. |
It seems strange though as it says DCO is disabled:
While I have drivers set up and the DCO interface is present in my system. 🤔 |
Can you provide the full log? I think it should say why dco is disabled. |
Sure:
|
maybe add |
Thank you for this option!
In my configuration the following lines were present:
I updated the configuration and leave only:
And it now works as expected:
|
Just leave a link to DCO supported features if someone will stumble upon this issue. 😅 |
This is needed to support domains with hyphens. Not using double quotes here, since our code replaces them with underbars (see https://github.com/OpenVPN/openvpn/blob/master/src/openvpn/win32.c#L980). Github: fixes #363 Change-Id: Iab536922d0731635cef529b5caf542f637b8d491 Signed-off-by: Lev Stipakov <lev@openvpn.net> Acked-by: Selva Nair <selva.nair@gmail.com> Message-Id: <20230710112122.576-1-lstipakov@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26841.html Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit 4057814)
When will we have a release that includes this fix? It breaks Network Location Awareness Service Provider (NLA) for dco configurations. |
The patch has been merged, and will be part of 2.6.6 release - which will be released in the next days (monday or tuesday, I hope). |
Describe the bug
I have a configuraiton in the
config-auto
. And it fails to setup a connection a system boot when usingwintun
interface. If I switch totap-windows6
driver in my configuration, the OpenVPN service can properly init the connection.Connection log:
Wintun configuration:
To Reproduce
config-auto
Expected behavior
OpenVPN automatically connects to the server
Version information (please complete the following information):
Additional context
I found a ticket that describes the same error code I received with my configuration. It seems that adding double quotes around a domain name with hyphens allows to successfully execute WMIC command.
Maybe it is worth escaping double quotes there:
openvpn/src/openvpn/tun.c
Line 336 in 53055fd
The text was updated successfully, but these errors were encountered: