urllib3: validate https certificate

This commit is contained in:
Noam Meltzer 2016-05-30 00:49:29 +03:00
parent b040568b07
commit 574fc8cddf
2 changed files with 3 additions and 1 deletions

View file

@ -1,2 +1,3 @@
future future
urllib3 urllib3
certifi

View file

@ -20,6 +20,7 @@
import json import json
import certifi
import urllib3 import urllib3
from telegram import (InputFile, TelegramError) from telegram import (InputFile, TelegramError)
@ -33,7 +34,7 @@ def _get_con_pool():
return _CON_POOL return _CON_POOL
global _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 return _CON_POOL