MCPcopy
hub / github.com/pimutils/vdirsyncer / prepare_verify

Function prepare_verify

vdirsyncer/http.py:62–84  ·  view source on GitHub ↗
(verify, verify_fingerprint)

Source from the content-addressed store, hash-verified

60
61
62def prepare_verify(verify, verify_fingerprint):
63 if isinstance(verify, (str, bytes)):
64 verify = expand_path(verify)
65 elif not isinstance(verify, bool):
66 raise exceptions.UserError('Invalid value for verify ({}), '
67 'must be a path to a PEM-file or boolean.'
68 .format(verify))
69
70 if verify_fingerprint is not None:
71 if not isinstance(verify_fingerprint, (bytes, str)):
72 raise exceptions.UserError('Invalid value for verify_fingerprint '
73 '({}), must be a string or null.'
74 .format(verify_fingerprint))
75 elif not verify:
76 raise exceptions.UserError(
77 'Disabling all SSL validation is forbidden. Consider setting '
78 'verify_fingerprint if you have a broken or self-signed cert.'
79 )
80
81 return {
82 'verify': verify,
83 'verify_fingerprint': verify_fingerprint,
84 }
85
86
87def prepare_client_cert(cert):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls 1

expand_pathFunction · 0.85

Tested by

no test coverage detected