Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5171fc commit 9e696ffCopy full SHA for 9e696ff
1 file changed
python/ql/test/query-tests/Security/CWE-327/ssl_fluent.py
@@ -85,3 +85,13 @@ def test_fluent_ssl_safe_version():
85
with socket.create_connection((hostname, 443)) as sock:
86
with context.wrap_socket(sock, server_hostname=hostname) as ssock:
87
print(ssock.version())
88
+
89
+# Taken from https://docs.python.org/3/library/ssl.html#context-creation
90
+def test_fluent_explicitly_unsafe():
91
+ hostname = 'www.python.org'
92
+ context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
93
+ context.options &= ~ssl.OP_NO_SSLv3 # This not recognized
94
95
+ with socket.create_connection((hostname, 443)) as sock:
96
+ with context.wrap_socket(sock, server_hostname=hostname) as ssock: # SSLv3 not flagged here
97
+ print(ssock.version())
0 commit comments