def check_cert():
"""
Checks availability of "cacert.pem" file installed by the certifi module
"""
LOGGER.info('certificate: checking')
import certifi
from emft.core.path import Path
cacert = str(Path(certifi.where()).abspath())
if not os.path.exists(cacert):
raise FileNotFoundError(cacert)
# # noinspection SpellCheckingInspection
# if not cacert.crc32() == 'D069EE01':
# raise ImportError('cacert.pem file is corrupted: {}'.format(cacert.crc32()))
LOGGER.debug('setting up local cacert file to: {}'.format(cacert))
os.environ['REQUESTS_CA_BUNDLE'] = cacert
LOGGER.info('certificate: checked')
评论列表
文章目录