From 9f39124015b8a15e33a6b3a581d3619ce15e2bc5 Mon Sep 17 00:00:00 2001 From: Krzysztof Kwiatkowski Date: Mon, 4 Jan 2016 13:27:15 +0100 Subject: [PATCH] Check if _create_unverified_context is supported before using it --- tncc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tncc.py b/tncc.py index 99d0fa9..a953a6b 100755 --- a/tncc.py +++ b/tncc.py @@ -11,7 +11,8 @@ import collections import zlib import HTMLParser -ssl._create_default_https_context = ssl._create_unverified_context +if hasattr(ssl, '_create_unverified_context'): + ssl._create_default_https_context = ssl._create_unverified_context # 0013 - Message def decode_0013(buf):