]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
doh: use https protocol by default
authorViktor Szakats <commit@vsz.me>
Sat, 16 Jul 2022 14:10:39 +0000 (14:10 +0000)
committerViktor Szakats <commit@vsz.me>
Sat, 16 Jul 2022 14:10:39 +0000 (14:10 +0000)
The only allowed protocol is https, so it makes sense to use that
by default if not passed explicitly by the user.

Reported-by: MasterInQuestion on github
Reviewed-by: Jay Satiro
Fixes #9163
Closes #9165

lib/doh.c

index a21c94f8801b842b2248c15e09d9c4bb7c816775..a86e157fc047ee64852dc561d9af543ddf190f79 100644 (file)
--- a/lib/doh.c
+++ b/lib/doh.c
@@ -243,6 +243,7 @@ static CURLcode dohprobe(struct Curl_easy *data,
        the gcc typecheck helpers */
     struct dynbuf *resp = &p->serverdoh;
     ERROR_CHECK_SETOPT(CURLOPT_URL, url);
+    ERROR_CHECK_SETOPT(CURLOPT_DEFAULT_PROTOCOL, "https");
     ERROR_CHECK_SETOPT(CURLOPT_WRITEFUNCTION, doh_write_cb);
     ERROR_CHECK_SETOPT(CURLOPT_WRITEDATA, resp);
     ERROR_CHECK_SETOPT(CURLOPT_POSTFIELDS, p->dohbuffer);