Repository navigation
Replies: 1 comment
|
Your log shows In HTTPX 0.28.1, an explicit transport does not inherit ssl_context = ssl.create_default_context(cafile=cert_file)
transport = httpx.HTTPTransport(
verify=ssl_context,
local_address="0.0.0.0",
retries=2,
# Keep any socket_options required by your existing setup here.
)
with httpx.Client(
transport=transport,
auth=httpx.DigestAuth(username, password),
headers=headers,
timeout=30.0,
follow_redirects=True,
) as client:
response = client.post(url, json=body)If you do not need a custom transport, the current gist's I checked the context wiring locally on HTTPX 0.28.1: a client-created transport used the supplied context; an explicit transport without |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
i am working on an interface to a smart meter device for an integration in Home Assistant. The device has an API that can be requested via https.
I was working with the python lib
requestsand that works. But the integration uses the libhttpx. But with this lib I cannot get the connection. To the same device, within the same network, same user, password, certificate.Where can be the difference?
I wrote a script, that tries to make the connection with both libs, but only the one made with
requestworks.I have to say, that between me and the device, there is small NAT Router; but could this affect the
httpx-connection and it works withrequests?This is the script
https://gist.github.com/klacol/d8b30cf0b08267c2366bed86b42302ee
This is the log from the first connection with
requests; works like a charm:This is the log from the second connection with
https; has errors:I know, it is complicated to help, without being able to replay this.
Any help appreciated
Thanks!
All reactions