Skip to content

Proxy information reported as (nil) in verbose logs #9937

@astamp

Description

@astamp

Hello,

We recently upgraded to curl 7.86.0 from 7.84.0 and noticed that the proxy information is not being reported correctly in the log messages.

swgroup@fwdev2-astamp:~/ES2$ http_proxy=http://192.168.2.1:8080 ./curl-7.86.0/src/curl -sv google.com -o /dev/null
* Uses proxy env variable http_proxy == 'http://192.168.2.1:8080'
*   Trying 192.168.2.1:8080...
* Connected to (nil) (192.168.2.1) port 8080 (#0)
> GET http://google.com/ HTTP/1.1

where 7.84.0 shows the proxy info correctly.

swgroup@fwdev2-astamp:~/ES2$ http_proxy=http://192.168.2.1:8080 ./curl-7.84.0/src/curl -sv google.com -o /dev/null
* Uses proxy env variable http_proxy == 'http://192.168.2.1:8080'
*   Trying 192.168.2.1:8080...
* Connected to 192.168.2.1 (192.168.2.1) port 8080 (#0)
> GET http://google.com/ HTTP/1.1
swgroup@fwdev2-astamp:~/ES2$ http_proxy=http://192.168.2.1:8080 ./curl-7.86.0/src/curl -sv google.com -o /dev/null
* Uses proxy env variable http_proxy == 'http://192.168.2.1:8080'
*   Trying 192.168.2.1:8080...
* Connected to (nil) (192.168.2.1) port 8080 (#0)
> GET http://google.com/ HTTP/1.1

Notice Connected to (nil) (192.168.2.1) port 8080 (#0) in 7.86 vs. Connected to 192.168.2.1 (192.168.2.1) port 8080 (#0) in 7.84.

Both versions of curl were configured with:

./configure --prefix=/home/swgroup --with-openssl --enable-verbose

It appears to be related to this commit: 53bcf55

In lib/url.c the calls to Curl_idnconvert_hostname were moved to parseurlandfillconn() which is called before create_conn_helper_init_proxy in create_conn.
While we are not using libidn2, Curl_idnconvert_hostname is where the dispname member of struct hostname is populated.
Since the calls are gated by conn->bits.httpproxy/conn->bits.socksproxy, the names are not converted since the bits are only set in create_conn_helper_init_proxy.

I'm not sure how to resolve this and still maintain the changes for HSTS needed for that commit, otherwise I'd propose a patch.

Thanks,
--Andy

I did this

With a proxy running at the specified info:

$ http_proxy=http://192.168.2.1:8080 ./curl-7.86.0/src/curl -sv google.com -o /dev/null

I expected the following

I expected to see Connected to 192.168.2.1 (192.168.2.1) port 8080 (#0) as is observed in curl 7.84.0.
but instead received: Connected to (nil) (192.168.2.1) port 8080 (#0)

curl/libcurl version

$ ./curl-7.86.0/src/curl -V
curl 7.86.0 (x86_64-pc-linux-gnu) libcurl/7.86.0 OpenSSL/1.0.2g zlib/1.2.8
Release-Date: 2022-10-26
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe TLS-SRP UnixSockets

operating system

Linux, but also observed in QNX.

$ uname -a
Linux fwdev2-astamp 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions