niquests: Unable to get http3 request against pie.dev

Hi there, I was directed here by @Ousret from a merge request on httpie - hopefully this is the right location to file this bug. Please note, I would be happy to provide any additional information and try out experiments if that helps debug this issue.

Summary

I expected to get a http3 connection to pie.dev

❯ python
Python 3.12.1 (main, Dec  8 2023, 18:57:37) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from niquests import Session
>>> 
>>> with Session() as s:
...     print(s.get("https://pie.dev/get"))
... 
<Response HTTP/2 [200]>
>>> from urllib3.contrib.hface import HTTPProtocolFactory, HTTP3Protocol
>>> 
>>> print(HTTPProtocolFactory.new(HTTP3Protocol))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dwt/.virtualenvs/tempenv-714d1721928c9/lib/python3.12/site-packages/urllib3/contrib/hface/protocols/_factories.py", line 126, in new
    return implementation_target(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: HTTP3ProtocolAioQuicImpl.__init__() missing 3 required keyword-only arguments: 'remote_address', 'server_name', and 'tls_config'

Reproduction Steps

See above

System Information

$ python -m niquests.help
❯ python --version
Python 3.12.1

~/C/P/httpie  🐍 tempenv-714d1721928c9 🌱 feature-tryout-niquests  
❯ macosver
10.16

~/C/P/httpie  🐍 tempenv-714d1721928c9 🌱 feature-tryout-niquests  
❯ pip list
Package            Version    Editable project location
------------------ ---------- -------------------------------
certifi            2023.11.17
cffi               1.16.0
charset-normalizer 3.3.2
cryptography       41.0.7
defusedxml         0.7.1
h11                0.14.0
h2                 4.1.0
hpack              4.0.0
httpie             4.0.0b1    /Users/dwt/Code/Projekte/httpie
hyperframe         6.0.1
idna               3.6
kiss-headers       2.4.3
markdown-it-py     3.0.0
mdurl              0.1.2
multidict          6.0.4
niquests           3.4.0
pip                23.3.2
pycparser          2.21
Pygments           2.17.2
python-socks       2.4.4
qh3                0.14.0
requests           2.31.0
requests-toolbelt  1.0.0
rich               13.7.0
setuptools         69.0.3
urllib3            2.1.0
urllib3-future     2.4.902
wassima            1.0.3

~/C/P/httpie  🐍 tempenv-714d1721928c9 🌱 feature-tryout-niquests  
❯ python -m niquests.help
{
  "charset_normalizer": {
    "version": "3.3.2"
  },
  "cryptography": {
    "version": "41.0.7"
  },
  "http1": {
    "h11": "0.14.0"
  },
  "http2": {
    "h2": "4.1.0"
  },
  "http3": {
    "enabled": true,
    "qh3": "0.14.0"
  },
  "idna": {
    "version": "3.6"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.12.1"
  },
  "niquests": {
    "version": "3.4.0"
  },
  "ocsp": {
    "enabled": true
  },
  "platform": {
    "release": "22.6.0",
    "system": "Darwin"
  },
  "system_ssl": {
    "version": "30200000"
  },
  "urllib3.future": {
    "version": "2.4.902"
  },
  "wassima": {
    "certifi_fallback": false,
    "enabled": true,
    "version": "1.0.3"
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 15

Most upvoted comments

Perfect. You can test it more and report back your experience with it at the HTTPie thread if you may.

could you perhaps elaborate why the first request didn’t work but the second did? Does the session need to collect the information that the host is http3 capable before trying it?

without a custom DNS, you cannot reach a HTTP/3 endpoint without prior establishing a HTTP/1 or HTTP/2 link, that’s why. but this https --resolver "doh+google://" pie.dev/get seems weird it did not complete to HTTP/3,