It seems in some scenarios curl is not printing out request/response headers and body content. For example the following request is invalid and correctly prints out the response headers:
$ curl --http2 -k 'https://10.0.2.2:13443/proxy/address' -d 'INVALID CONTENT' -i
HTTP/2.0 400
server:http2query2
However the following 2 requests are valid but does not print out any response headers:
$ curl --http2 -k 'https://10.0.2.2:13443/proxy/address' -d 'VALID CONTENT' -i
$
$ curl --http2 -k 'https://10.0.2.2:13443/proxy/address' -d 'VALID CONTENT' -s -D -
$
Also the body is not printed in the second case.
Ignore the parts about the body not being printed at the end. This response has no body for these requests.
Last edit: Scott Mitchell 2014-09-29
Ok, so what's left on this bug report? That -i isn't including the headers in the regular output?
It does for me, I just did this command line successfully:
$ curl --http2 https://nghttp2.org/ -i -o dump
I am able to see the connection statistics but I am still not seeing response headers (or any other content in your example). I am using the latest on master. Should I be using a specific tag?
So what do you see? I tried again just now and it works fine for me. Add "--trace-ascii dump2" and attached that dump2 file for us to take a look!
Can you really negotiate ALPN with that OpenSSL version?
My test version reports this:
$ ./src/curl --version
curl 7.38.1-DEV (x86_64-unknown-linux-gnu) libcurl/7.38.1-DEV OpenSSL/1.1.0 zlib/1.2.8 c-ares/1.10.1-DEV libidn/1.29 libssh2/1.4.4_DEV nghttp2/0.6.2-DEV librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS Debug TrackMemory IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 Metalink
My mistake. I apologize...I do see the responses for the
curl --http2 https://nghttp2.org/ -i -o dump --trace-ascii dump2request (both dump and dump2 have reasonable content). I'm a curl novice and am not familiar with the flags...I was looking for results on the console.However I still think there is an issue with the results not being printed if their is no response body and the status code is 200. I couldn't find a scenario for this on
https://nghttp2.org/httpbinbut my web server supports a request that only provides a header response. I have not been able to generalize it past this because if my server responds with a non-200 code I see thedumpfile (using the syntax above), but it is not generated if the return code is 200. The--trace-ascii dump2is produced in both situations however (see attached files).Yes. ALPN support was added in openssl 1.0.2 according to their website
You mean like when running "curl --http2 -I https://nghttp2.org/" ?
Seems to work fine for me!
From a print out perspective, yes this is what I expect. However this example is not equivalent to the description I provided. This example URL is returning headers and a body. If you have an example that only returns headers that would be equivalent.
I am guessing (without looking at code) that the END_STREAM flag in the headers frame is not being used the same way that a
content-length: 0header might be to inidate no more response is coming?My example did only output headers and no body. Can you please provide me with an example against a public URL that repeats the problem you're talking about?
How is END_STREAM related to how we output headers or not?
No further response, closing.