Catch cert error in posh query
This commit is contained in:
parent
a943a35a5d
commit
ea34959b35
|
@ -43,6 +43,7 @@ import hashlib
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import base64
|
import base64
|
||||||
|
import ssl
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from string import Template
|
from string import Template
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
@ -1281,7 +1282,7 @@ class Connection(CommonConnection, ConnectionHandlers):
|
||||||
try:
|
try:
|
||||||
file = urlopen(
|
file = urlopen(
|
||||||
url, cafile=cafile, timeout=2)
|
url, cafile=cafile, timeout=2)
|
||||||
except URLError as exc:
|
except (URLError, ssl.CertificateError) as exc:
|
||||||
log.info('Error while requesting POSH: %s' % exc)
|
log.info('Error while requesting POSH: %s' % exc)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue