Index: curl-7.65.3/lib/url.c =================================================================== --- curl-7.65.3.orig/lib/url.c 2021-01-07 20:48:52.563356616 +0800 +++ curl-7.65.3/lib/url.c 2021-01-07 20:51:04.322928025 +0800 @@ -2886,12 +2886,14 @@ /* for updated strings, we update them in the URL */ if(user_changed) { - uc = curl_url_set(data->state.uh, CURLUPART_USER, *userp, 0); + uc = curl_url_set(data->state.uh, CURLUPART_USER, *userp, + CURLU_URLENCODE); if(uc) return Curl_uc_to_curlcode(uc); } if(passwd_changed) { - uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD, *passwdp, 0); + uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD, *passwdp, + CURLU_URLENCODE); if(uc) return Curl_uc_to_curlcode(uc); }