Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Forcing Cleartext HTTP2 Without Upgrade Mechanism #427

Open
iamthebot opened this issue Feb 25, 2020 · 3 comments
Open

Forcing Cleartext HTTP2 Without Upgrade Mechanism #427

iamthebot opened this issue Feb 25, 2020 · 3 comments

Comments

@iamthebot
Copy link

Is there a way to send a request to a server that only supports HTTP2 (eg; running libnghttp2) without requiring the upgrade mechanism (which many HTTP2 only implementations do not support)?

In curl, there's a http2-prior-knowledge flag that accomplishes this.

@ghost
Copy link

ghost commented Mar 4, 2020

I want this too! Any idea whether it is possible?

@ghost
Copy link

ghost commented Mar 4, 2020

Note: I tried the flag with curl (--http2-prior-knowledge), but it still sends:

POST /blablbla/bla HTTP/1.1

Connection: Upgrade, HTTP2-Settings
Upgrade: h2c

Any idea why?

I am using:

curl -V

curl 7.68.0 (x86_64-redhat-linux-gnu) libcurl/7.68.0 NSS/3.44 zlib/1.2.7 libpsl/0.7.0 (+libicu/50.1.2) libssh2/1.9.0 nghttp2/1.31.1
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz Metalink NTLM NTLM_WB PSL SPNEGO SSL UnixSockets

@zetahernandez
Copy link

you can bypass the protocol negotiation and talk directly with a HTTP2 only server this way.

from hyper.http20.connection import HTTP20Connection
connection = HTTP20Connection(
     host='localhost',
     port=8888,
)
request = connection.request('POST', '/', body="")
response = connection.get_response(request)
body = response.read()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants