close

How to add a custom CA Root certificate to the CA Store used by pip in Windows?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to add a custom CA Root certificate to the CA Store used by pip in Windows in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to add a custom CA Root certificate to the CA Store used by pip in Windows?

  1. How to add a custom CA Root certificate to the CA Store used by pip in Windows?

    Alternative solution on Windows is to install python-certifi-win32 that will allow Python to use Windows Certificate Store.

  2. add a custom CA Root certificate to the CA Store used by pip in Windows

    Alternative solution on Windows is to install python-certifi-win32 that will allow Python to use Windows Certificate Store.

Method 1

Run: python -c "import ssl; print(ssl.get_default_verify_paths())" to check the current paths which are used to verify the certificate. Add your company’s root certificate to one of those.

The path openssl_capath_env points to the environment variable: SSL_CERT_DIR.

If SSL_CERT_DIR doesn’t exist, you will need to create it and point it to a valid folder within your filesystem. You can then add your certificate to this folder to use it.

Method 2

Alternative solution on Windows is to install python-certifi-win32 that will allow Python to use Windows Certificate Store.

pip install python-certifi-win32

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read