Add verify_mode to ssl context

CURA-7176
This commit is contained in:
Jaime van Kessel 2020-03-05 16:06:27 +01:00
parent d501f7730a
commit bffe79d96c
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -44,6 +44,7 @@ class FirmwareUpdateCheckerJob(Job):
try:
# CURA-6698 Create an SSL context and use certifi CA certificates for verification.
context = ssl.SSLContext(protocol = ssl.PROTOCOL_TLSv1_2)
context.verify_mode = ssl.CERT_REQUIRED
context.load_verify_locations(cafile = certifi.where())
request = urllib.request.Request(url, headers = self._headers)