Skip to content
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

libcurl with doh show logs for windows #11864

Closed
calvin2021y opened this issue Sep 15, 2023 · 5 comments
Closed

libcurl with doh show logs for windows #11864

calvin2021y opened this issue Sep 15, 2023 · 5 comments
Labels
name lookup DNS and related tech Windows Windows-specific

Comments

@calvin2021y
Copy link

I did this

try use libcurl with DOH from windows, the logs always show on console and I am not sure how to turn it off.

I expected the following

I expect it not show like 8.2

curl/libcurl version

curl 8.3

operating system

windows

@bagder bagder added Windows Windows-specific name lookup DNS and related tech labels Sep 15, 2023
@bagder
Copy link
Member

bagder commented Sep 15, 2023

How to reproduce?

@calvin2021y
Copy link
Author

calvin2021y commented Sep 16, 2023

not have a full example, just like this:

  handle = curl_easy_init();
  curl_easy_setopt(handle, CURLOPT_WRITEDATA, file);
  curl_easy_setopt(handle, CURLOPT_PRIVATE, file);
  curl_easy_setopt(handle, CURLOPT_URL, url);

  curl_easy_setopt(handle, CURLOPT_REFERER, url);
  curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(handle, CURLOPT_AUTOREFERER, 1L);
  curl_easy_setopt(handle, CURLOPT_HEADER, 0L);
  curl_easy_setopt(handle, CURLOPT_DOH_URL, "https://dns.google/dns-query");
  curl_easy_setopt(handle, CURLOPT_REDIR_PROTOCOLS, -1);

  curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 1L);
  curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L);
  curl_easy_setopt(handle, CURLOPT_VERBOSE, 1L);
  curl_easy_setopt(handle, CURLOPT_DEBUGFUNCTION, my_trace);

and CURLOPT_DEBUGFUNCTION just leave empty

static
int my_trace(CURL *handle, curl_infotype type,
             char *data, size_t size,
             void *clientp)
{
  return 0;
}

there will be output into console:

== Info: a DoH request is completed, 0 to go
== Info: DoH request SSL peer certificate or SSH remote key was not OK
== Info: DoH: Too small type A for www.google.com
== Info: DoH: Too small type AAAA for www.google.com
== Info: Closing connection

for old version the verbose info is send into CURLOPT_DEBUGFUNCTION, or silent not show on console()

@calvin2021y
Copy link
Author

sorry, my mistake.

add CURL_DISABLE_VERBOSE_STRINGS seems remove this message. (I must use this for my old build)

@calvin2021y
Copy link
Author

add CURL_DISABLE_VERBOSE_STRINGS seems remove all trace information.

@calvin2021y calvin2021y reopened this Sep 16, 2023
@bagder
Copy link
Member

bagder commented Sep 16, 2023

I wonder if this is because the doh transfer inherits the VERBOSE option but it does not inherit the CURLOPT_DEBUGFUNCTION so it will rather use the default verbose logging ... which defaults to stderr.

bagder added a commit that referenced this issue Sep 16, 2023
When creating new transfers for doing DoH, they now inherit the debug
settings from the initiating transfer, so that the application can
redirect and handle the verbose output correctly even for the DoH
transfers.

Reported-by: calvin2021y on github
Fixes #11864
@bagder bagder closed this as completed in f8cee8c Sep 16, 2023
ptitSeb pushed a commit to wasix-org/curl that referenced this issue Sep 25, 2023
When creating new transfers for doing DoH, they now inherit the debug
settings from the initiating transfer, so that the application can
redirect and handle the verbose output correctly even for the DoH
transfers.

Reported-by: calvin2021y on github
Fixes curl#11864
Closes curl#11869
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
name lookup DNS and related tech Windows Windows-specific
Development

Successfully merging a pull request may close this issue.

2 participants