From 574fc8cddfd1183df8d7260a0dabc233f3b45429 Mon Sep 17 00:00:00 2001 From: Noam Meltzer Date: Mon, 30 May 2016 00:49:29 +0300 Subject: [PATCH] urllib3: validate https certificate --- requirements.txt | 1 + telegram/utils/request.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9e7a55731..678e22607 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ future urllib3 +certifi diff --git a/telegram/utils/request.py b/telegram/utils/request.py index 8600f5c31..5926add9f 100644 --- a/telegram/utils/request.py +++ b/telegram/utils/request.py @@ -20,6 +20,7 @@ import json +import certifi import urllib3 from telegram import (InputFile, TelegramError) @@ -33,7 +34,7 @@ def _get_con_pool(): return _CON_POOL global _CON_POOL - _CON_POOL = urllib3.PoolManager(10) + _CON_POOL = urllib3.PoolManager(10, cert_reqs='CERT_REQUIRED', ca_certs=certifi.where()) return _CON_POOL