Closed
Description
I did this
#include <curl/curl.h>
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.se");
curl_easy_setopt(curl, CURLOPT_PROXY, "http://curl.se:80");
curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "mrsmith%aaa");
curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty%4b!");
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}
I expected the following
Proxy should get username "mrsmith%aaa" and password "qwerty%4b!".
But proxy gets this:
* Proxy auth using Basic with user 'mrsmitha'
> GET http://curl.se/ HTTP/1.1
Host: curl.se
Proxy-Authorization: Basic bXJzbWl0aKphOnF3ZXJ0eUsh
Accept: */*
Proxy-Connection: Keep-Alive
After base64 decoding auth string "bXJzbWl0aKphOnF3ZXJ0eUsh" is "mrsmitha:qwertyK!".
But auth string should be "mrsmith%aaa:qwerty%4b!".
According documentation, CURLOPT_PROXYUSERNAME and CURLOPT_PROXYPASSWORD values are not supposed to be url-encoded.
Only CURLOPT_PROXYUSERPWD value is supposed to be url-encoded.
curl/libcurl version
8.7.0 and earlier
operating system
all
Activity
url: do not URL decode proxy crendentials
url: do not URL decode proxy crendentials