You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CONNECT fails if it can't send the entire request in one go #6950
There are Proxy which need Kerberos Authentication, but the authentication flow sometimes failed . This not easy to reproduce.
After checking the wireshark captured file and source code of libcurl. We find the possible root cause of the issue.
CURLcode Curl_buffer_send(struct dynbuf *in,
struct connectdata *conn,
/* add the number of sent bytes to this
counter */
curl_off_t *bytes_written,
/* how much of the buffer contains body data */
size_t included_body_bytes,
int socketindex)
{
...
sendsize = CURLMIN(size, CURL_MAX_WRITE_SIZE);
...
else {
if((size_t)amount != size)
/* We have no continue-send mechanism now, fail. This can only happen
when this function is used from the CONNECT sending function. We
currently (stupidly) assume that the whole request is always sent
away in the first single chunk.
This needs FIXing.
*/
return CURLE_SEND_ERROR;
}
}
When the Kerberos Auth challenge is bigger than CURL_MAX_WRITE_SIZE (16384) , the request with auth will be failed. (Will be fallbacked to using NTLM in our user's proxy environment.)
changed the title [-]Output Kerberos Auth failed if the challenge is bigger than CURL_MAX_WRITE_SIZE[/-][+]CONNECT fails if it can't send the entire request in one go[/+]on May 6, 2021
Activity
bagder commentedon May 3, 2021
Any proposal on how to fix this?
ustcqidi commentedon May 6, 2021
@bagder
We are fixing this by a workaround, just send the "real" size when sending "proxy-authorization header"
here is the pull request #7019
could you please help to review whether is it make sense ? Thanks.
bagder commentedon May 6, 2021
btw, is this perchance in a
CONNECTrequest?ustcqidi commentedon May 6, 2021
yes, in the function of CONNECT of http_proxy.c
static CURLcode CONNECT(struct connectdata *conn,
int sockindex,
const char *hostname,
int remote_port)
bagder commentedon May 6, 2021
I figured out how to write a test case for this issue that reproduces your problem and shows that http_proxy.c:CONNECT needs to be fixed:
test363
This test limits the initial CONNECT request send to 100 bytes, which breaks curl.
[-]Output Kerberos Auth failed if the challenge is bigger than CURL_MAX_WRITE_SIZE[/-][+]CONNECT fails if it can't send the entire request in one go[/+]ustcqidi commentedon May 8, 2021
@bagder
many thanks