Skip to content

curl-7.63.0 not sending POST body when using --negotiate #3384

@cstivers78

Description

@cstivers78

I did this

We use kerberos (GSSAPI/SPNEGO) for authenticating against web services. It seems something broke in 7.63.0, where POST bodies are not being transmitted when --negotiate is being used.

Example command use:

curl --negotiate -u ':' -H "Content-Type: application/json" -d '{"audiences":["people"]}' -XPOST https://some.api --trace-ascii trace.log

When I checked the trace.log, I saw:

785: User-Agent: curl/7.63.0
179e: Accept: */*
17ab: Content-Type: application/json
17cb: Content-Length: 0
17de:
=> Send SSL data, 5 bytes (0x5)
0000: ....!
<= Recv SSL data, 5 bytes (0x5)
0000: .....
<= Recv header, 13 bytes (0xd)
0000: HTTP/2 400
<= Recv header, 37 bytes (0x25)
0000: date: Mon, 17 Dec 2018 19:41:10 GMT
<= Recv header, 41 bytes (0x29)
0000: content-type: text/plain; charset=utf-8
<= Recv header, 20 bytes (0x14)
0000: content-length: 49
<= Recv header, 62 bytes (0x3e)
0000: www-authenticate: Negotiate <<OMITTED>>
<= Recv header, 2 bytes (0x2)
0000:
<= Recv data, 49 bytes (0x31)
0000: {"status":400,"message":"Invalid request body."}.
<= Recv SSL data, 5 bytes (0x5)
0000: ....!

Notice Content-Length: 0 and No Body.

I expected the following

I expected to see the body transmitted, with a computed Content-Length header.

For example, the same command ran in curl-7.54.0 yields:

1761: User-Agent: curl/7.54.0
177a: Accept: */*
1787: Content-Type: application/json
17a7: Content-Length: 24
17bb:
=> Send data, 24 bytes (0x18)
0000: {"audiences":["people"]}
== Info: We are completely uploaded and fine
<= Recv header, 13 bytes (0xd)
0000: HTTP/2 200
<= Recv header, 37 bytes (0x25)
0000: date: Mon, 17 Dec 2018 19:34:06 GMT
<= Recv header, 47 bytes (0x2f)
0000: content-type: application/json; charset=utf-8
<= Recv header, 21 bytes (0x15)
0000: content-length: 750
<= Recv header, 62 bytes (0x3e)
0000: www-authenticate: Negotiate <<OMITTED>>
<= Recv header, 2 bytes (0x2)
0000:
<= Recv data, 750 bytes (0x2ee)
0000:  <<OMITTED>>
== Info: Connection #0 to host some.api left intact

curl/libcurl version

[curl -V output]

curl --version
curl 7.63.0 (x86_64-pc-linux-gnu) libcurl/7.63.0 OpenSSL/1.1.1a zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.4) libssh2/1.8.0 nghttp2/1.34.0
Release-Date: 2018-12-12
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL

operating system

Occurrect on both Linux and Mac

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions