How to use certificate stored in windows certificates manager using python

Viewed 415
  1. My python application is running locally on http://0.0.0.0:80/
  2. Later, to make SSL connection I generated MyCert.crt and Mycert.key files.
  3. Later, after providing the location of certificate and key files. My application works perfect and starts running over https connection as per expectation.

    code snippet: from OpenSSL import SSL

    context = ("C:/myCert.crt", "C:/Mycert.key") app.run(host="0.0.0.0", port='80',ssl_context = context)

  4. Now, I import the same certificate to: windows certificates manager -> Trusted Root Certification Authorities. It shows certificate name as localhost

  5. Now, my goal is to access the certificate for same python application and start using it from windows certificate manager. I referred couple of libraries(requests, wincertstore) but I am unable to understand them as I am new in this domain.

How Do I modify my python code to access this certificate.

1 Answers
Related