mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-28182: Expose OpenSSL verification results (#3412)
The SSL module now raises SSLCertVerificationError when OpenSSL fails to verify the peer's certificate. The exception contains more information about the error. Original patch by Chi Hsuan Yen Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
af8d6b9072
commit
b3ad0e5127
5 changed files with 134 additions and 19 deletions
|
@ -129,11 +129,26 @@ Functions, Constants, and Exceptions
|
|||
|
||||
.. versionadded:: 3.3
|
||||
|
||||
.. exception:: SSLCertVerificationError
|
||||
|
||||
A subclass of :exc:`SSLError` raised when certificate validation has
|
||||
failed.
|
||||
|
||||
.. versionadded:: 3.7
|
||||
|
||||
.. attribute:: verify_code
|
||||
|
||||
A numeric error number that denotes the verification error.
|
||||
|
||||
.. attribute:: verify_message
|
||||
|
||||
A human readable string of the verification error.
|
||||
|
||||
.. exception:: CertificateError
|
||||
|
||||
Raised to signal an error with a certificate (such as mismatching
|
||||
hostname). Certificate errors detected by OpenSSL, though, raise
|
||||
an :exc:`SSLError`.
|
||||
an :exc:`SSLCertVerificationError`.
|
||||
|
||||
|
||||
Socket creation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue