mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-26 06:46:13 +01:00
- raise more specific exceptions
This commit is contained in:
parent
67caa8b555
commit
ca7ad96ec9
@ -513,10 +513,10 @@ def _build_opener(url):
|
||||
capath = i
|
||||
break
|
||||
if not cafile and not capath:
|
||||
raise Exception('No CA certificates found')
|
||||
raise oscerr.OscIOError(None, 'No CA certificates found')
|
||||
ctx = oscssl.mySSLContext()
|
||||
if ctx.load_verify_locations(capath=capath, cafile=cafile) != 1:
|
||||
raise Exception('No CA certificates found')
|
||||
raise oscerr.OscIOError(None, 'No CA certificates found')
|
||||
opener = m2urllib2.build_opener(ctx, oscssl.myHTTPSHandler(ssl_context=ctx, appname='osc'), HTTPCookieProcessor(cookiejar), authhandler, proxyhandler)
|
||||
else:
|
||||
print("WARNING: SSL certificate checks disabled. Connection is insecure!\n", file=sys.stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user