[Python] Python Requests using PFX certificate wont work ! - OpenSSL.SSL.Error: [('PEM...

Discussão em 'Python' iniciado por Stack, Fevereiro 16, 2025.

  1. Stack

    Stack Membro Participativo

    I've scoured Stack trying to find the answer to this. I basically have a certificate installed and can access the XML file via chrome, but I am trying to pull it directly into python using requests.

    I'm simply using

    response = requests.get(url, cert='C:\\Users\\User\\Cert.pfx')


    I have not included the url, as it can't be reached for replication without the certificate regardless.

    I keep receiving the error

    OpenSSL.SSL.Error: [('PEM routines', 'get_name', 'no start line'), ('SSL
    routines', 'use_certificate_chain_file', 'PEM lib')]


    I'm using Python 3 on a windows machine. I'm pretty confident the PFX certificate has been exported successfully, but if I do have to convert it to PEM, I am unsure how to do that correctly. Perhaps I do not have to do so, but then I am unsure why I am getting a PEM error. Thank you in advance for any help.

    Continue reading...

Compartilhe esta Página