验证证书时出现python[SSL]PEM库(_SSL.c:3309)错误

验证证书时出现python[SSL]PEM库(_SSL.c:3309)错误,python,python-3.x,ssl,ssl-certificate,Python,Python 3.x,Ssl,Ssl Certificate,我正在尝试向web服务器发送POST消息。 为了做到这一点,我正在使用python请求并尝试将一个证书作为参数传递给requests.post方法 看起来是这样的: if method_type == METHOD_TYPE_GET: resp = requests.get(base_url, data=request_data, verify=True, headers=headers, cert=certificate) if method_type == M

我正在尝试向web服务器发送POST消息。 为了做到这一点,我正在使用python请求并尝试将一个证书作为参数传递给requests.post方法

看起来是这样的:

    if method_type == METHOD_TYPE_GET:
        resp = requests.get(base_url, data=request_data, verify=True, headers=headers, cert=certificate)
    if method_type == METHOD_TYPE_POST:
        resp = requests.post(base_url, data=request_data, verify=True, headers=headers, cert=certificate)
    return resp
当“certificate”是包含服务器证书的pem文件的路径时。该文件的格式为:

-----开始证书-----

-Base64数据-

-----结束证书-----

当我尝试执行post方法时,我得到一个异常:[SSL]PEM lib(_SSL.c:3309)


知道问题是什么吗?

请检查openssl-配置文件设置中的以下参数 extendedKeyUsage=clientAuth