Skip to content

Instantly share code, notes, and snippets.


Eduardo Luiz eduardoluizgs

View GitHub Profile
erikbern /
Last active Mar 21, 2021
How to use a .pfx file with Python requests – also works with .p12 files
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
def pfx_to_pem(pfx_path, pfx_password):
''' Decrypts the .pfx file to be used with requests. '''