summaryrefslogtreecommitdiffstats
path: root/Lib/test/ssl_servers.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-12-22 09:03:38 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-12-22 09:03:38 (GMT)
commit0e576f1f50df1201c56bff7573ab8576e8ab2041 (patch)
treee6934d5a26fc1b6604b79046877b788cd75b22f4 /Lib/test/ssl_servers.py
parent5ad1af076c3e2b888c8b9401efe1201738e9962c (diff)
downloadcpython-0e576f1f50df1201c56bff7573ab8576e8ab2041.zip
cpython-0e576f1f50df1201c56bff7573ab8576e8ab2041.tar.gz
cpython-0e576f1f50df1201c56bff7573ab8576e8ab2041.tar.bz2
Issue #13626: Add support for SSL Diffie-Hellman key exchange, through the
SSLContext.load_dh_params() method and the ssl.OP_SINGLE_DH_USE option.
Diffstat (limited to 'Lib/test/ssl_servers.py')
-rw-r--r--Lib/test/ssl_servers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py
index becbfab..8686153 100644
--- a/Lib/test/ssl_servers.py
+++ b/Lib/test/ssl_servers.py
@@ -180,6 +180,8 @@ if __name__ == "__main__":
parser.add_argument('--curve-name', dest='curve_name', type=str,
action='store',
help='curve name for EC-based Diffie-Hellman')
+ parser.add_argument('--dh', dest='dh_file', type=str, action='store',
+ help='PEM file containing DH parameters')
args = parser.parse_args()
support.verbose = args.verbose
@@ -192,6 +194,8 @@ if __name__ == "__main__":
context.load_cert_chain(CERTFILE)
if args.curve_name:
context.set_ecdh_curve(args.curve_name)
+ if args.dh_file:
+ context.load_dh_params(args.dh_file)
server = HTTPSServer(("", args.port), handler_class, context)
if args.verbose: