summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDaniël van Eeden <git@myname.nl>2016-01-16 18:00:52 +0100
committerDaniël van Eeden <git@myname.nl>2016-01-16 18:00:52 +0100
commitae8243da06e61e56cc347f6baebb4c6061be1ef1 (patch)
tree28a3ca26aaba6261f78fd32b02c441a605054f68 /examples
parentb3316fc4e8ffabce720fa825fccc8fcb2c7256c6 (diff)
downloadpyopenssl-git-ae8243da06e61e56cc347f6baebb4c6061be1ef1.tar.gz
Don't use SSLv2 or SSLv3 in examples/simple
Diffstat (limited to 'examples')
-rw-r--r--examples/simple/client.py2
-rw-r--r--examples/simple/server.py1
2 files changed, 3 insertions, 0 deletions
diff --git a/examples/simple/client.py b/examples/simple/client.py
index 36c37cd..dff2d03 100644
--- a/examples/simple/client.py
+++ b/examples/simple/client.py
@@ -27,6 +27,8 @@ if dir == '':
# Initialize context
ctx = SSL.Context(SSL.SSLv23_METHOD)
+ctx.set_options(SSL.OP_NO_SSLv2)
+ctx.set_options(SSL.OP_NO_SSLv3)
ctx.set_verify(SSL.VERIFY_PEER, verify_cb) # Demand a certificate
ctx.use_privatekey_file (os.path.join(dir, 'client.pkey'))
ctx.use_certificate_file(os.path.join(dir, 'client.cert'))
diff --git a/examples/simple/server.py b/examples/simple/server.py
index df7c5a4..bc001ed 100644
--- a/examples/simple/server.py
+++ b/examples/simple/server.py
@@ -29,6 +29,7 @@ if dir == '':
# Initialize context
ctx = SSL.Context(SSL.SSLv23_METHOD)
ctx.set_options(SSL.OP_NO_SSLv2)
+ctx.set_options(SSL.OP_NO_SSLv3)
ctx.set_verify(SSL.VERIFY_PEER|SSL.VERIFY_FAIL_IF_NO_PEER_CERT, verify_cb) # Demand a certificate
ctx.use_privatekey_file (os.path.join(dir, 'server.pkey'))
ctx.use_certificate_file(os.path.join(dir, 'server.cert'))