3

Hi I am new to SSL and I am trying to connect to an IIS ASP.NET web server which has issued to me a unique .pfx certificate to verify me to the server.

Using a browser where I have installed the certificate I am able to connect the site where I have to upload a file on a daily basis.

I am trying to write a python script to do the same task. I have tried to use the Python Mechanize library.

While adding certificate I converted the .pfx file to .key and .cer PEM file so that it could be attached to add_client_certificate method, but later, I found out that IIS server accepts only .pfx certificate and there is no way to attach a .pfx certificate directly to the Mechanize browser instance.

Is there a way or another library where I can do this task?

Hemant
  • 225
  • 4
  • 17

1 Answers1

1

You can use requests library

import requests
requests.get("https://your_server", cert=('client01.cer', 'client01.key'))
kem
  • 11
  • 2