Skip to content

Commit 482b95e

Browse files
authored
Removed redundant code in SSL.py that depended on old version of cryptography (#1290)
1 parent 1508c4b commit 482b95e

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/OpenSSL/SSL.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -163,20 +163,11 @@
163163
DTLS_SERVER_METHOD = 11
164164
DTLS_CLIENT_METHOD = 12
165165

166-
try:
167-
SSL3_VERSION = _lib.SSL3_VERSION
168-
TLS1_VERSION = _lib.TLS1_VERSION
169-
TLS1_1_VERSION = _lib.TLS1_1_VERSION
170-
TLS1_2_VERSION = _lib.TLS1_2_VERSION
171-
TLS1_3_VERSION = _lib.TLS1_3_VERSION
172-
except AttributeError:
173-
# Hardcode constants for cryptography < 3.4, see
174-
# https://github.com/pyca/pyopenssl/pull/985#issuecomment-775186682
175-
SSL3_VERSION = 768
176-
TLS1_VERSION = 769
177-
TLS1_1_VERSION = 770
178-
TLS1_2_VERSION = 771
179-
TLS1_3_VERSION = 772
166+
SSL3_VERSION = _lib.SSL3_VERSION
167+
TLS1_VERSION = _lib.TLS1_VERSION
168+
TLS1_1_VERSION = _lib.TLS1_1_VERSION
169+
TLS1_2_VERSION = _lib.TLS1_2_VERSION
170+
TLS1_3_VERSION = _lib.TLS1_3_VERSION
180171

181172
OP_NO_SSLv2 = _lib.SSL_OP_NO_SSLv2
182173
OP_NO_SSLv3 = _lib.SSL_OP_NO_SSLv3

0 commit comments

Comments
 (0)