You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When making request as below to try to verify server certificate fingerprint 'digest' during http request:
tcp_connector = TCPConnector(ssl=aiohttp.Fingerprint(digest))
async with aiohttp.ClientSession(headers=headers, connector=tcp_connector, trust_env=True) as session:
async with session.request(...) as r:
....
If the request go directly to the server, the server fingerprint is verified successfully: when the 'digest' matches the server certificate fingerprint digest, the request succeed, when it doesn't match, a 'aiohttp.ServerFingerprintMismatch' exception is thrown.
While if the request need to go through a http proxy (with env: HTTP_PROXY, HTTPS_PROXY set as the proxy), the server fingerprint is not verified: whether the 'digest' matches the server certificate fingerprint digest or not, the request will always succeed, no 'aiohttp.ServerFingerprintMismatch' exception is thrown.
To Reproduce
setup a "http server" and a "http proxy" through which the "http server" can be requested.
write a simple program as above:
tcp_connector = TCPConnector(ssl=aiohttp.Fingerprint(digest))
async with aiohttp.ClientSession(headers=headers, connector=tcp_connector) as session:
async with session.request(...) as r:
....
set the 'digest' as a mismatch one as the http server's certificate fingerprint digest
3. the request can be made successfully
Expected behavior
The request should fail with a 'aiohttp.ServerFingerprintMismatch' exception.
gangj
changed the title
Server certificate fingerprint is not verified when request though http proxy
Server certificate fingerprint is not verified when request through http proxy
Mar 9, 2022
Describe the bug
When making request as below to try to verify server certificate fingerprint 'digest' during http request:
If the request go directly to the server, the server fingerprint is verified successfully: when the 'digest' matches the server certificate fingerprint digest, the request succeed, when it doesn't match, a 'aiohttp.ServerFingerprintMismatch' exception is thrown.
While if the request need to go through a http proxy (with env: HTTP_PROXY, HTTPS_PROXY set as the proxy), the server fingerprint is not verified: whether the 'digest' matches the server certificate fingerprint digest or not, the request will always succeed, no 'aiohttp.ServerFingerprintMismatch' exception is thrown.
To Reproduce
set the 'digest' as a mismatch one as the http server's certificate fingerprint digest
3. the request can be made successfully
Expected behavior
The request should fail with a 'aiohttp.ServerFingerprintMismatch' exception.
Logs/tracebacks
Python Version
aiohttp Version
multidict Version
yarl Version
OS
$ cat /etc/issue
Ubuntu 20.04.4 LTS \n \l
Related component
Client
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: