mkdir -p /tmp/custom-certs cp ~/Download/foo.example.com.cert /tmp/custom-certs cp ~/Download/bar.example.com.cert /tmp/custom-certs c_rehash /tmp/custom-certs export REQUESTS_CA_BUNDLE='/tmp/custom-certs'
My question is where does SSL client code get the trusted CA certificates from, from Django, Python or the underlying OS?
As per official documentation of requests library:By default, Requests bundles a set of root CAs that it trusts, sourced from the Mozilla trust store. However, these are only updated once for each Requests version. This means that if you pin a Requests version your certificates can become extremely out of date.From Requests version 2.4.0 onwards, Requests will attempt to use certificates from certifi if it is present on the system. This allows for users to update their trusted certificates without having to change the code that runs on their system.For the sake of security we recommend upgrading certifi frequently!You can read more about certifi on it's official docs page.
What configuration do I need in order for the SSL client to conduct the SSL handshake successfully?
You can set REQUESTS_CA_BUNDLE environment variable pointing to .cert file and it will pick it from there.If you have just one `.crt` file which is self signed then you can do followingexport REQUESTS_CA_BUNDLE='~/Download/bar.example.com.cert'But if you have multiple certificates which are self signed then you can put them in a folder and set the folder path in environment variable. In case of a folder, make sure to run c_rehash command for folder.mkdir -p /tmp/custom-certs cp ~/Download/foo.example.com.cert /tmp/custom-certs cp ~/Download/bar.example.com.cert /tmp/custom-certs export REQUESTS_CA_BUNDLE='/tmp/custom-certs'Relevant source code in requests library: https://github.com/kennethreitz/requests/blob/v2.13.0/requests/sessions.py#L658-L662
----
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f07875b8-f3b8-4bcb-b95f-2d936f5ece34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Regards,
Pankaj Kumar Singh
My question is where does SSL client code get the trusted CA certificates from, from Django, Python or the underlying OS?
By default, Requests bundles a set of root CAs that it trusts, sourced from the Mozilla trust store. However, these are only updated once for each Requests version. This means that if you pin a Requests version your certificates can become extremely out of date.
From Requests version 2.4.0 onwards, Requests will attempt to use certificates from certifi if it is present on the system. This allows for users to update their trusted certificates without having to change the code that runs on their system.
For the sake of security we recommend upgrading certifi frequently!
What configuration do I need in order for the SSL client to conduct the SSL handshake successfully?
export REQUESTS_CA_BUNDLE='~/Download/bar.example.com.cert'
mkdir -p /tmp/custom-certs cp ~/Download/foo.example.com.cert /tmp/custom-certs cp ~/Download/bar.example.com.cert /tmp/custom-certs export REQUESTS_CA_BUNDLE='/tmp/custom-certs'
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f07875b8-f3b8-4bcb-b95f-2d936f5ece34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f07875b8-f3b8-4bcb-b95f-2d936f5ece34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c3d34bad-244b-4ab4-a893-47a639919f19%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c3d34bad-244b-4ab4-a893-47a639919f19%40googlegroups.com.