Some ssl fixes (#919)

Fix return of wrap_socket.
Add read, write, pending to SSLSocket
Fix argument to socket.setdefaulttimeout
This commit is contained in:
David Euresti
2017-02-06 17:23:22 -08:00
committed by Guido van Rossum
parent 06074e1e02
commit 6eca1a04da
5 changed files with 11 additions and 6 deletions

View File

@@ -361,5 +361,5 @@ def inet_aton(ip_string: str) -> str: ... # ret val 4 bytes in length
def inet_ntoa(packed_ip: str) -> str: ...
def inet_pton(address_family: int, ip_string: str) -> str: ...
def inet_ntop(address_family: int, packed_ip: str) -> str: ...
def getdefaulttimeout() -> Union[float, None]: ...
def setdefaulttimeout(timeout: float) -> None: ...
def getdefaulttimeout() -> Optional[float]: ...
def setdefaulttimeout(timeout: Optional[float]) -> None: ...

View File

@@ -148,6 +148,10 @@ class SSLSocket(socket.socket):
def selected_npn_protocol(self) -> Optional[str]: ...
def unwrap(self) -> socket.socket: ...
def version(self) -> Optional[str]: ...
def read(self, len: int = ...,
buffer: Optional[bytearray] = ...) -> str: ...
def write(self, buf: str) -> int: ...
def pending(self) -> int: ...
class SSLContext:
@@ -178,7 +182,7 @@ class SSLContext:
def wrap_socket(self, sock: socket.socket, server_side: bool = ...,
do_handshake_on_connect: bool = ...,
suppress_ragged_eofs: bool = ...,
server_hostname: Optional[str] = ...) -> 'SSLContext': ...
server_hostname: Optional[str] = ...) -> SSLSocket: ...
def session_stats(self) -> Dict[str, int]: ...

View File

@@ -357,5 +357,5 @@ def inet_aton(ip_string: str) -> bytes: ... # ret val 4 bytes in length
def inet_ntoa(packed_ip: bytes) -> str: ...
def inet_pton(address_family: int, ip_string: str) -> bytes: ...
def inet_ntop(address_family: int, packed_ip: bytes) -> str: ...
def getdefaulttimeout() -> Union[float, None]: ...
def setdefaulttimeout(timeout: float) -> None: ...
def getdefaulttimeout() -> Optional[float]: ...
def setdefaulttimeout(timeout: Optional[float]) -> None: ...

View File

@@ -229,7 +229,7 @@ class SSLContext:
def wrap_socket(self, sock: socket.socket, server_side: bool = ...,
do_handshake_on_connect: bool = ...,
suppress_ragged_eofs: bool = ...,
server_hostname: Optional[str] = ...) -> 'SSLContext': ...
server_hostname: Optional[str] = ...) -> SSLSocket: ...
if sys.version_info >= (3, 5):
def wrap_bio(self, incoming: 'MemoryBIO', outgoing: 'MemoryBIO',
server_side: bool = ...,

View File

@@ -30,6 +30,7 @@ def url2pathname(path: str) -> str: ...
def pathname2url(path: str) -> str: ...
def getproxies() -> Dict[str, str]: ...
def parse_http_list(s: str) -> List[str]: ...
def parse_keqv_list(l: List[str]) -> Dict[str, str]: ...
class Request:
if sys.version_info >= (3, 4):