http.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:splunk_ta_ps4_f1_2016 作者: jonathanvarley 项目源码 文件源码
def _send_request(self, uri, method, headers=None, body=None):
        """Do send request to target URL and validate SSL cert by default.
        If validation failed, disable it and try again."""
        if self._connection is None:
            self._connection = self._build_http_connection(
                proxy_info=self._proxy_info,
                disable_ssl_cert_validation=False)

        try:
            return self._connection.request(
                uri, body=body, method=method, headers=headers
            )
        except SSLHandshakeError:
            _logger.warning(
                "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verification failed. "
                "The certificate of the https server [%s] is not trusted, "
                "this add-on will proceed to connect with this certificate. "
                "You may need to check the certificate and "
                "refer to the documentation and add it to the trust list. %s",
                uri,
                traceback.format_exc()
            )

            self._connection = self._build_http_connection(
                proxy_info=self._proxy_info,
                disable_ssl_cert_validation=True
            )
            return self._connection.request(
                uri, body=body, method=method, headers=headers
            )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号