@@ -183,9 +183,11 @@ def test_hardened_ssl_context_options_default(self):
183183
184184 # Verify the options were OR'd into the context
185185 self .assertEqual (context .options & expected_options , expected_options )
186+ # Verify that the minimum TLS version is enforced
187+ self .assertEqual (context .minimum_version , ssl .TLSVersion .TLSv1_2 )
186188
187- def test_hardened_ssl_context_options_tls1_1_only (self ):
188- """Test SSL context options are set correctly with TLS 1.1 only """
189+ def test_hardened_ssl_context_options_tls1_1 (self ):
190+ """Test SSL context options are set correctly with TLS 1.1 enabled """
189191 config = self .configuration
190192 config .logger = self .logger
191193
@@ -197,15 +199,15 @@ def test_hardened_ssl_context_options_tls1_1_only(self):
197199 STRONG_TLS_CIPHERS ,
198200 STRONG_TLS_CURVES ,
199201 True ,
200- False ,
202+ True ,
201203 False
202204 )
203205
204206 # Verify options are set
205207 expected_options = (
206208 getattr (ssl , 'OP_NO_SSLv2' , 0x1000000 ) |
207209 getattr (ssl , 'OP_NO_SSLv3' , 0x2000000 ) |
208- getattr (ssl , 'OP_NO_TLSv1_2 ' , 0x8000000 ) |
210+ getattr (ssl , 'OP_NO_TLSv1 ' , 0x4000000 ) |
209211 getattr (ssl , 'OP_NO_COMPRESSION' , 0x20000 ) |
210212 getattr (ssl , 'OP_CIPHER_SERVER_PREFERENCE' , 0x400000 ) |
211213 getattr (ssl , 'OP_SINGLE_ECDH_USE' , 0x80000 ) |
@@ -216,6 +218,8 @@ def test_hardened_ssl_context_options_tls1_1_only(self):
216218
217219 # Verify the options were OR'd into the context
218220 self .assertEqual (context .options & expected_options , expected_options )
221+ # Verify that the minimum TLS version is enforced
222+ self .assertEqual (context .minimum_version , ssl .TLSVersion .TLSv1_1 )
219223
220224 def test_hardened_ssl_context_options_tls1_3_only (self ):
221225 """Test SSL context options are set correctly with TLS 1.3 only"""
@@ -251,6 +255,8 @@ def test_hardened_ssl_context_options_tls1_3_only(self):
251255
252256 # Verify the options were OR'd into the context
253257 self .assertEqual (context .options & expected_options , expected_options )
258+ # Verify that the minimum TLS version is enforced
259+ self .assertEqual (context .minimum_version , ssl .TLSVersion .TLSv1_3 )
254260
255261 def test_hardened_ssl_context_options_fail_reneg (self ):
256262 """Test SSL context options fail when different"""
0 commit comments