Python: Add import test of py/insecure-protocol

This commit is contained in:
Rasmus Wriedt Larsen
2023-02-21 15:47:36 +01:00
parent 27e2307d0c
commit fb425b73fc
4 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import ssl
secure_context = ssl.SSLContext(ssl.PROTOCOL_TLS)
secure_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1
# this is just to allow us to see how un-altered exports work
completely_insecure_context = ssl.SSLContext(ssl.PROTOCOL_TLS)
# and an insecure export that is refined
also_insecure_context = ssl.SSLContext(ssl.PROTOCOL_TLS)
also_insecure_context.options |= ssl.OP_NO_TLSv1