Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 164b383

Browse files
yoffRasmusWL
andauthored
Update python/ql/test/query-tests/Security/CWE-327/pyOpenSSL_fluent.py
Co-authored-by: Rasmus Wriedt Larsen <[email protected]>
1 parent e0e6d57 commit 164b383

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

python/ql/test/query-tests/Security/CWE-327/pyOpenSSL_fluent.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ def test_fluent_safe():
2929
conn = SSL.Connection(context, socket.socket(socket.AF_INET, socket.SOCK_STREAM))
3030
r = conn.connect((hostname, 443))
3131
print(r, conn.get_protocol_version_name())
32+
33+
def test_safe_by_construction():
34+
hostname = 'www.python.org'
35+
context = SSL.Context(SSL.TLSv1_2_METHOD)
36+
37+
conn = SSL.Connection(context, socket.socket(socket.AF_INET, socket.SOCK_STREAM))
38+
r = conn.connect((hostname, 443))
39+
print(conn.get_protocol_version_name())

0 commit comments

Comments
 (0)