Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-128192: support HTTP sha-256 digest authentication as per RFC-7617 #128193

Merged
merged 15 commits into from
Dec 28, 2024
Merged
2 changes: 2 additions & 0 deletions Lib/urllib/request.py
calvinbui marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,8 @@ def get_algorithm_impls(self, algorithm):
elif algorithm == 'SHA':
gpshead marked this conversation as resolved.
Show resolved Hide resolved
H = lambda x: hashlib.sha1(x.encode("ascii")).hexdigest()
# XXX MD5-sess
elif algorithm == 'SHA-256':
calvinbui marked this conversation as resolved.
Show resolved Hide resolved
H = lambda x: hashlib.sha256(x.encode("ascii")).hexdigest()
else:
raise ValueError("Unsupported digest authentication "
"algorithm %r" % algorithm)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support digest authentication algorithm SHA-256 in :mod:`urllib.request`.
calvinbui marked this conversation as resolved.
Show resolved Hide resolved
Loading