]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
socks: allow using DoH to resolve host names
authorDaniel Stenberg <daniel@haxx.se>
Thu, 16 Feb 2023 22:52:22 +0000 (23:52 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 17 Feb 2023 08:17:54 +0000 (09:17 +0100)
For SOCKS modes where a local host resolve is done.

It was previously disabled in 12d655d4561, but a few local tests seem to
indicate that it works fine. Works now because of the SOCKS refactor of
4a4b63daaa01ef59 that made it non-blocking.

Reported-by: roughtex on github
Fixes #10537
Closes #10540

lib/socks.c

index d7d2b748a320a4b26fef4672f8e0551e7ee19271..95c2b004c964f5665cc43b11e6bdd5d716dabf81 100644 (file)
@@ -316,7 +316,7 @@ static CURLproxycode do_SOCKS4(struct Curl_cfilter *cf,
     /* DNS resolve only for SOCKS4, not SOCKS4a */
     if(!protocol4a) {
       enum resolve_t rc =
-        Curl_resolv(data, sx->hostname, sx->remote_port, FALSE, &dns);
+        Curl_resolv(data, sx->hostname, sx->remote_port, TRUE, &dns);
 
       if(rc == CURLRESOLV_ERROR)
         return CURLPX_RESOLVE_HOST;
@@ -783,7 +783,7 @@ static CURLproxycode do_SOCKS5(struct Curl_cfilter *cf,
   case CONNECT_REQ_INIT:
     if(socks5_resolve_local) {
       enum resolve_t rc = Curl_resolv(data, sx->hostname, sx->remote_port,
-                                      FALSE, &dns);
+                                      TRUE, &dns);
 
       if(rc == CURLRESOLV_ERROR)
         return CURLPX_RESOLVE_HOST;