Created
March 1, 2015 20:16
-
-
Save alex/1cff35a2e673c11567cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Modules/_ssl.c b/Modules/_ssl.c | |
index 0e6abda..61d7294 100644 | |
--- a/Modules/_ssl.c | |
+++ b/Modules/_ssl.c | |
@@ -2219,6 +2219,13 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds) | |
sizeof(SID_CTX)); | |
#undef SID_CTX | |
+#ifdef X509_V_FLAG_TRUSTED_FIRST | |
+ { | |
+ X509_STORE *store = SSL_CTX_get_cert_store(self->ctx); | |
+ X509_STORE_set_flags(store, X509_V_FLAG_TRUSTED_FIRST); | |
+ } | |
+#endif | |
+ | |
return (PyObject *)self; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment