mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Server-side SSL and certificate validation, by Bill Janssen.
While cleaning up Bill's C style, I may have cleaned up some code he didn't touch as well (in _ssl.c).
This commit is contained in:
parent
1a42ece0c7
commit
4f2c3ddca4
7 changed files with 1037 additions and 97 deletions
|
@ -68,11 +68,10 @@ if _have_ssl:
|
|||
|
||||
_realsocket = socket
|
||||
if _have_ssl:
|
||||
_realssl = ssl
|
||||
def ssl(sock, keyfile=None, certfile=None):
|
||||
if hasattr(sock, "_sock"):
|
||||
sock = sock._sock
|
||||
return _realssl(sock, keyfile, certfile)
|
||||
import ssl as realssl
|
||||
return realssl.sslwrap_simple(sock, keyfile, certfile)
|
||||
__all__.append("ssl")
|
||||
|
||||
# WSA error codes
|
||||
if sys.platform.lower().startswith("win"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue