massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / pyOpenSSL / OpenSSL / SSL.pyi
1 import socket
2 from typing import Any, Callable, Sequence
3
4 from OpenSSL.crypto import X509, PKey
5
6 OPENSSL_VERSION_NUMBER: int
7 SSLEAY_VERSION: int
8 SSLEAY_CFLAGS: int
9 SSLEAY_PLATFORM: int
10 SSLEAY_DIR: int
11 SSLEAY_BUILT_ON: int
12
13 SENT_SHUTDOWN: int
14 RECEIVED_SHUTDOWN: int
15
16 SSLv2_METHOD: int
17 SSLv3_METHOD: int
18 SSLv23_METHOD: int
19 TLSv1_METHOD: int
20 TLSv1_1_METHOD: int
21 TLSv1_2_METHOD: int
22
23 TLS_METHOD: int
24 TLS_SERVER_METHOD: int
25 TLS_CLIENT_METHOD: int
26
27 SSL3_VERSION: int
28 TLS1_VERSION: int
29 TLS1_1_VERSION: int
30 TLS1_2_VERSION: int
31 TLS1_3_VERSION: int
32
33 OP_NO_SSLv2: int
34 OP_NO_SSLv3: int
35 OP_NO_TLSv1: int
36 OP_NO_TLSv1_1: int
37 OP_NO_TLSv1_2: int
38 OP_NO_TLSv1_3: int
39
40 MODE_RELEASE_BUFFERS: int
41
42 OP_SINGLE_DH_USE: int
43 OP_SINGLE_ECDH_USE: int
44 OP_EPHEMERAL_RSA: int
45 OP_MICROSOFT_SESS_ID_BUG: int
46 OP_NETSCAPE_CHALLENGE_BUG: int
47 OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: int
48
49 OP_SSLREF2_REUSE_CERT_TYPE_BUG: int
50 OP_MICROSOFT_BIG_SSLV3_BUFFER: int
51 OP_MSIE_SSLV2_RSA_PADDING: int
52 OP_SSLEAY_080_CLIENT_DH_BUG: int
53 OP_TLS_D5_BUG: int
54 OP_TLS_BLOCK_PADDING_BUG: int
55 OP_DONT_INSERT_EMPTY_FRAGMENTS: int
56 OP_CIPHER_SERVER_PREFERENCE: int
57 OP_TLS_ROLLBACK_BUG: int
58 OP_PKCS1_CHECK_1: int
59 OP_PKCS1_CHECK_2: int
60 OP_NETSCAPE_CA_DN_BUG: int
61 OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: int
62
63 OP_NO_COMPRESSION: int
64
65 OP_NO_QUERY_MTU: int
66 OP_COOKIE_EXCHANGE: int
67 OP_NO_TICKET: int
68
69 OP_ALL: int
70
71 VERIFY_PEER: int
72 VERIFY_FAIL_IF_NO_PEER_CERT: int
73 VERIFY_CLIENT_ONCE: int
74 VERIFY_NONE: int
75
76 SESS_CACHE_OFF: int
77 SESS_CACHE_CLIENT: int
78 SESS_CACHE_SERVER: int
79 SESS_CACHE_BOTH: int
80 SESS_CACHE_NO_AUTO_CLEAR: int
81 SESS_CACHE_NO_INTERNAL_LOOKUP: int
82 SESS_CACHE_NO_INTERNAL_STORE: int
83 SESS_CACHE_NO_INTERNAL: int
84
85 SSL_ST_CONNECT: int
86 SSL_ST_ACCEPT: int
87 SSL_ST_MASK: int
88
89 SSL_CB_LOOP: int
90 SSL_CB_EXIT: int
91 SSL_CB_READ: int
92 SSL_CB_WRITE: int
93 SSL_CB_ALERT: int
94 SSL_CB_READ_ALERT: int
95 SSL_CB_WRITE_ALERT: int
96 SSL_CB_ACCEPT_LOOP: int
97 SSL_CB_ACCEPT_EXIT: int
98 SSL_CB_CONNECT_LOOP: int
99 SSL_CB_CONNECT_EXIT: int
100 SSL_CB_HANDSHAKE_START: int
101 SSL_CB_HANDSHAKE_DONE: int
102
103 NO_OVERLAPPING_PROTOCOLS: object
104
105 class Error(Exception): ...
106 class WantReadError(Error): ...
107 class WantWriteError(Error): ...
108 class WantX509LookupError(Error): ...
109 class ZeroReturnError(Error): ...
110 class SysCallError(Error): ...
111
112 def SSLeay_version(type: int) -> str: ...
113
114 class Session(object): ...
115
116 class Connection(object):
117     def __getattr__(self, name: str) -> Any: ...  # incomplete
118     def __init__(self, context: Context, socket: socket.socket | None = ...) -> None: ...
119     def connect(self, addr: str | bytes | Sequence[str | int]) -> None: ...
120     def do_handshake(self) -> None: ...
121     def get_peer_certificate(self) -> X509: ...
122     def set_tlsext_host_name(self, name: bytes) -> None: ...
123     def bio_read(self, bufsiz: int) -> bytes: ...
124     def bio_write(self, buf: bytes) -> int: ...
125     def recv(self, bufsiz: int, flags: int | None = ...) -> bytes: ...
126     def sendall(self, buf: bytes, flags: int = ...) -> int: ...
127     def set_accept_state(self) -> None: ...
128     def set_connect_state(self) -> None: ...
129     def get_peer_cert_chain(self) -> list[X509]: ...
130     def get_alpn_proto_negotiated(self) -> bytes: ...
131     def get_cipher_name(self) -> str | None: ...
132     def get_protocol_version_name(self) -> str: ...
133     def get_shutdown(self) -> int: ...
134     def get_app_data(self) -> Any: ...
135     def set_app_data(self, data: Any) -> None: ...
136
137 class Context(object):
138     def __getattr__(self, name: str) -> Any: ...  # incomplete
139     def __init__(self, method: int) -> None: ...
140     def load_verify_locations(self, cafile: str | None, capath: str | None = ...) -> None: ...
141     def set_options(self, options: int) -> None: ...
142     def set_verify(self, mode: int, callback: Callable[[Connection, X509, int, int, int], bool] | None = ...) -> None: ...
143     # will be added in pyOpenSSL 21
144     # def set_min_proto_version(self, version: int) -> None: ...
145     # def set_max_proto_version(self, version: int) -> None: ...
146     def use_certificate_chain_file(self, certfile: str | bytes) -> None: ...
147     def use_certificate_file(self, certfile: str | bytes, filetype: int = ...) -> None: ...
148     def use_certificate(self, cert: X509) -> None: ...
149     def use_privatekey_file(self, keyfile: str | bytes, filetype: int | None = ...) -> None: ...
150     def use_privatekey(self, pkey: PKey) -> None: ...
151     def add_extra_chain_cert(self, certobj: X509) -> None: ...
152     def set_cipher_list(self, cipher_list: bytes) -> None: ...
153     def set_keylog_callback(self, callback: Callable[[Connection, bytes], None]) -> None: ...
154     def set_alpn_protos(self, protos: Sequence[bytes]) -> None: ...
155     def set_alpn_select_callback(self, callback: Callable[[Connection, list[bytes]], bytes]) -> None: ...