Commit Graph

25 Commits

Author SHA1 Message Date
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Nipunn Koorapati
ca5cb9d006 Restore the global SSL flags to typeshed (#4247)
Audited this - and ensured the globals were gated under
the appropriate python versions for the boolean vars.
https://docs.python.org/3/library/ssl.html

Fixes #4246
2020-06-19 17:41:28 -07:00
Jelle Zijlstra
43e93f803f use _typeshed's Path aliases (#4214) 2020-06-10 20:57:09 -07:00
Sam Bull
bd35cd6bf8 Fixes for ssl (#4164) 2020-06-03 21:42:31 +02:00
Sam Bull
dd5ef5ed1e Add hostname_checks_common_name attribute to SSLContext (#4160) 2020-06-03 11:19:02 +02:00
karl ding
43cf0ec870 ssl: Improve SSLContext.options stub (#4152)
In Python 3.6, the SSLContext.options flags were converted from int to
EnumFlag values.

In addition, add the missing OP_ENABLE_MIDDLEBOX_COMPAT constant
introduced in version 3.6.

In addition, add the missing OP_NO_RENEGOTIATION constant introduced in
version 3.7.
2020-06-02 09:19:18 +02:00
Florimond Manca
efe23f8cc1 Add ssl.PROTOCOL_TLS for Python 2.7 (#3855) 2020-03-24 00:12:32 +01:00
Shantanu
e4b4cd99c0 ssl: various fixes (#3789)
* ssl: fix arg names, mark positional-only args
* ssl: add undocumented parameter to do_handshake
* ssl: fix type of password in load_cert_chain
* ssl: add session parameter to wrap_socket, wrap_bio in py36 on
* ssl: update whitelists
2020-02-29 14:08:47 +01:00
Shantanu
295c20211d ssl: fix arguments for py36 and below (#3640) 2020-01-23 15:10:36 +01:00
Alex Grönholm
7b5e9dca48 Added explicit SSLSocket.accept() definition (#3564) 2020-01-05 16:14:42 +01:00
Alex Grönholm
83f9d833fb Fixed missing methods, wrong names and types (#3560)
Changes:

* Added the missing methods `selected_alpn_protocol()` and `version()` to `SSLObject`
* Fixed the naming of the `shared_ciphers()` method in `SSLSocket` and `SSLObject` (was missing the last "s")
* Fixed return type of `cipher()` (it's documented to return `None` if no connection has been established)
* Fixed second argument in cipher and shared_ciphers

The TLS version is a string, like "TLSv1.2".

* Added explicit overloads for getpeercert()

Its return type can be determined statically based on the `binary_form` argument.
2019-12-29 16:02:18 +01:00
Sebastian Rittau
ec7960a8cb Convert namedtuples to class syntax (#3321) 2019-10-20 10:37:33 +02:00
Sebastian Rittau
0501e2b329 Annotations for remaining Python 3.8 additions (#3358)
* Add os.add_dll_directory()
* Add memfd_create() and flags
* Add type annotation to flags
* Add stat_result.st_reparse_tag and flags
* Add ncurses_version
* Add Path.link_to()
* Add Picker.reducer_override()
* Add plistlib.UID
* Add has_dualstack_ipv6() and create_server()
* Add shlex.join()
* Add SSL methods and fields
* Add Python 3.8 statistics functions and classes
* Remove obsolete sys.subversion
* Add sys.unraisablehook
* Add threading.excepthook
* Add get_native_id() and Thread.native_id
* Add Python 3.8 tkinter methods
* Add CLOCK_UPTIME_RAW
* Add SupportsIndex
* Add typing.get_origin() and get_args()
* Add unicodedata.is_normalized
* Add unittest.mock.AsyncMock

Currently this is just an alias for Any like Mock and MagicMock. All of
these classes should probably be sub-classing Any and add their own
methods. See also #3224.

* Add unittest cleanup methods
* Add IsolatedAsyncioTestCase
* Add ElementTree.canonicalize() and C14NWriterTarget
* cProfile.Profile can be used as a context manager
* Add asyncio task name handling
* mmap.flush() now always returns None
* Add posonlyargcount to CodeType
2019-10-14 09:53:48 +02:00
Sebastian Rittau
d41bcd39e1 Add assorted annotations (#3335)
* Add assorted annotations

* Fix type of Purpose items
2019-10-10 20:51:49 -07:00
Jeremy Lainé
41d23a67f6 ssl: add VerifyFlags flags and VerifyMode enum (#3302)
Closes #3301
2019-10-04 16:27:30 +02:00
Daniel Holth
1d21315773 ssl.pyi: Add functions, support Path (#3044) 2019-09-03 12:10:48 +02:00
Samuel Freilich
75ccbdcab5 cadata param can (and PEM-encoded cadata must) be unicode under PY2 (#3150) 2019-08-23 08:25:41 +02:00
Sebastian Rittau
9ccf9356bf Remove Python 3.4 support (#3147)
Closes #3123
2019-07-27 10:58:21 +02:00
Hynek Schlawack
47450629c9 Add TLSVersion & related attributes to SSLContext (#3097) 2019-07-01 14:03:57 +02:00
秋葉
2b6a99c39c fix ssl.Purpose type in py3 (#3054) 2019-06-20 19:41:32 +02:00
Alexander Fasching
6258e7ddfd ssl.pyi: fix types of cadata argument (#3063) 2019-06-16 14:11:10 -07:00
Hynek Schlawack
7b69e48d1b Add SSLCertVerificationError fields (#2745) 2019-01-17 16:48:34 +01:00
Hynek Schlawack
0854df365d Add SSLCertVerificationError for 3.7+ (#2729)
As of 3.7, ssl.CertificateError became an alias for the new
SSLCertVerificationError.
2019-01-09 09:17:39 +01:00
Sebastian Rittau
006a79220f Flake8 fixes (#2549)
* Fix over-indented continuation lines

* Fix under-indented continuation lines

* Fix whitespace around default operator problems

* Limit line lengths

* Fix inconsistent files
2018-10-24 07:20:53 -07:00
Sebastian Rittau
a3031adb46 Merge Python 2 and 3 SSL stubs (#2175) 2018-05-31 21:44:42 -07:00