Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose some DTLS-related features #1026

Merged
merged 16 commits into from
Nov 2, 2021
Next Next commit
Expose DTLS_METHOD and friends
  • Loading branch information
njsmith committed Oct 27, 2021
commit f5ad068453cb32e03cb87e482cc28abb7c2bf89f
12 changes: 11 additions & 1 deletion src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
"TLS_METHOD",
"TLS_SERVER_METHOD",
"TLS_CLIENT_METHOD",
"DTLS_METHOD",
"DTLS_SERVER_METHOD",
"DTLS_CLIENT_METHOD",
"SSL3_VERSION",
"TLS1_VERSION",
"TLS1_1_VERSION",
Expand Down Expand Up @@ -149,6 +152,9 @@ class _buffer(object):
TLS_METHOD = 7
TLS_SERVER_METHOD = 8
TLS_CLIENT_METHOD = 9
DTLS_METHOD = 10
DTLS_SERVER_METHOD = 11
DTLS_CLIENT_METHOD = 12

try:
SSL3_VERSION = _lib.SSL3_VERSION
Expand Down Expand Up @@ -628,7 +634,8 @@ class Context(object):
:class:`OpenSSL.SSL.Context` instances define the parameters for setting
up new SSL connections.

:param method: One of TLS_METHOD, TLS_CLIENT_METHOD, or TLS_SERVER_METHOD.
:param method: One of TLS_METHOD, TLS_CLIENT_METHOD, TLS_SERVER_METHOD,
DTLS_METHOD, DTLS_CLIENT_METHOD, or DTLS_SERVER_METHOD.
SSLv23_METHOD, TLSv1_METHOD, etc. are deprecated and should
not be used.
"""
Expand All @@ -643,6 +650,9 @@ class Context(object):
TLS_METHOD: "TLS_method",
TLS_SERVER_METHOD: "TLS_server_method",
TLS_CLIENT_METHOD: "TLS_client_method",
DTLS_METHOD: "DTLS_method",
DTLS_SERVER_METHOD: "DTLS_server_method",
DTLS_CLIENT_METHOD: "DTLS_client_method",
}
_methods = dict(
(identifier, getattr(_lib, name))
Expand Down