mirror of
https://github.com/curl/curl.git
synced 2026-08-26 12:33:38 +03:00
- Hang Kin Lau found and fixed: When I use libcurl to connect to an https
server through a proxy and have the remote https server port set using the CURLOPT_PORT option, protocol gets reset to http from https after the first request. User defined URL was modified internally by libcurl and subsequent reuse of the easy handle may lead to connection using a different protocol (if not originally http). I found that libcurl hardcoded the protocol to "http" when it tries to regenerate the URL if CURLOPT_PORT is set. I tried to fix the problem as follows and it's working fine so far
This commit is contained in:
parent
638c715a51
commit
060f7ca2d2
3 changed files with 18 additions and 3 deletions
|
|
@ -3590,8 +3590,8 @@ else {
|
|||
/* we need to create new URL with the new port number */
|
||||
char *url;
|
||||
|
||||
url = aprintf("http://%s:%d%s", conn->host.name, conn->remote_port,
|
||||
data->reqdata.path);
|
||||
url = aprintf("%s://%s:%d%s", conn->protostr, conn->host.name,
|
||||
conn->remote_port, data->reqdata.path);
|
||||
if(!url)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue