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?
You can use requests library
import requests
requests.get("https://your_server", cert=('client01.cer', 'client01.key'))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.