本文整理汇总了Python中saml2.config.Config.disable_ssl_certificate_validation方法的典型用法代码示例。如果您正苦于以下问题:Python Config.disable_ssl_certificate_validation方法的具体用法?Python Config.disable_ssl_certificate_validation怎么用?Python Config.disable_ssl_certificate_validation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类saml2.config.Config
的用法示例。
在下文中一共展示了Config.disable_ssl_certificate_validation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from saml2.config import Config [as 别名]
# 或者: from saml2.config.Config import disable_ssl_certificate_validation [as 别名]
def __init__(self, idp_conf, logger, conf, publicKey, privateKey, metadataList):
"""
Constructor.
Initiates the class.
:param logger: Logger to be used when something needs to be logged.
:param conf: idp_proxy_conf see IdpProxy/conig/idp_proxy_conf.example.py
:param key: A RSA key to be used for encryption.
:param metadataList: A list of metadata files.
[{"local": ["swamid-1.0.xml"]}, {"local": ["sp.xml"]}]
:raise:
"""
if (logger is None) or (conf is None) or (publicKey is None)or (privateKey is None):
raise ValueError(
"A new instance must include a value for logger, conf and key.")
#Public key to be used for encryption.
self.publicKey = publicKey
self.privateKey = privateKey
#Used for presentation of mako files.
self.lookup = TemplateLookup(
directories=[MetadataGeneration.CONST_STATIC_MAKO + 'templates',
MetadataGeneration.CONST_STATIC_MAKO + 'htdocs'],
module_directory='modules',
input_encoding='utf-8',
output_encoding='utf-8')
#The logger.
self.logger = logger
#A list of all social services used by this IdPproxy.
self.socialServiceKeyList = []
#A list of all service providers used by this sp.
self.spKeyList = []
for key in conf:
self.socialServiceKeyList.append(conf[key]["name"])
try:
xmlsec_path = get_xmlsec_binary(["/opt/local/bin"])
except:
try:
xmlsec_path = get_xmlsec_binary(["/usr/local/bin"])
except:
self.logger.info('Xmlsec must be installed! Tries /usr/bin/xmlsec1.')
xmlsec_path = '/usr/bin/xmlsec1'
self.xmlsec_path = xmlsec_path
config = Config()
config.disable_ssl_certificate_validation = True
config.key_file = idp_conf["key_file"]
config.cert_file = idp_conf["cert_file"]
config.xmlsec_binary = idp_conf["xmlsec_binary"]
config.debug = idp_conf["debug"]
for metadata in metadataList:
mds = MetadataStore(MetadataGeneration.CONST_ONTS.values(),
MetadataGeneration.CONST_ATTRCONV, config)
mds.imp(metadata)
for entityId in mds.keys():
self.spKeyList.append(entityId)
示例2: __init__
# 需要导入模块: from saml2.config import Config [as 别名]
# 或者: from saml2.config.Config import disable_ssl_certificate_validation [as 别名]
def __init__(self, user, passwd, sp="", idp=None, metadata_file=None,
xmlsec_binary=None, verbose=0, ca_certs="",
disable_ssl_certificate_validation=True, key_file=None,
cert_file=None, config=None):
"""
:param user: user name
:param passwd: user password
:param sp: The SP URL
:param idp: The IdP PAOS endpoint
:param metadata_file: Where the metadata file is if used
:param xmlsec_binary: Where the xmlsec1 binary can be found (*)
:param verbose: Chatty or not
:param ca_certs: is the path of a file containing root CA certificates
for SSL server certificate validation (*)
:param disable_ssl_certificate_validation: If
disable_ssl_certificate_validation is true, SSL cert validation
will not be performed (*)
:param key_file: Private key filename (*)
:param cert_file: Certificate filename (*)
:param config: Config() instance, overrides all the parameters marked
with an asterisk (*) above
"""
if not config:
config = Config()
config.disable_ssl_certificate_validation = \
disable_ssl_certificate_validation
config.key_file = key_file
config.cert_file = cert_file
config.ca_certs = ca_certs
config.xmlsec_binary = xmlsec_binary
Entity.__init__(self, "sp", config)
self._idp = idp
self._sp = sp
self.user = user
self.passwd = passwd
self._verbose = verbose
if metadata_file:
self._metadata = MetadataStore([saml, samlp], None, config)
self._metadata.load("local", metadata_file)
logger.debug("Loaded metadata from '%s'" % metadata_file)
else:
self._metadata = None
self.metadata = self._metadata
self.cookie_handler = None
self.done_ecp = False
self.cookie_jar = cookielib.LWPCookieJar()