Skip to content

Instantly share code, notes, and snippets.

@alex
Created March 1, 2015 20:14
Show Gist options
  • Save alex/aa785c6b8ec6b089c9d4 to your computer and use it in GitHub Desktop.
Save alex/aa785c6b8ec6b089c9d4 to your computer and use it in GitHub Desktop.
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 0e6abda..f28979a 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -2218,6 +2218,8 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
SSL_CTX_set_session_id_context(self->ctx, (const unsigned char *) SID_CTX,
sizeof(SID_CTX));
#undef SID_CTX
+ X509_STORE *store = SSL_CTX_get_cert_store(self->ctx);
+ X509_STORE_set_flags(store, X509_V_FLAG_TRUSTED_FIRST);
return (PyObject *)self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment