summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-10-13 12:46:13 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-10-13 12:46:13 (GMT)
commitfc113eeb7d540cf27c66992c15879daeafbce402 (patch)
tree6d90832139ceab1f6a3e1663a95fb1354b306c12 /Modules
parent48e00f3ab6538eaff7bb5734a6dc13bc09e3792f (diff)
downloadcpython-fc113eeb7d540cf27c66992c15879daeafbce402.zip
cpython-fc113eeb7d540cf27c66992c15879daeafbce402.tar.gz
cpython-fc113eeb7d540cf27c66992c15879daeafbce402.tar.bz2
Define a "session_id_context" at context creation. This is recommended
for the OpenSSL server-side session cache.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ssl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 4f7bb4d..499ecba 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -1478,6 +1478,11 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
SSL_CTX_set_verify(self->ctx, SSL_VERIFY_NONE, NULL);
SSL_CTX_set_options(self->ctx, SSL_OP_ALL);
+#define SID_CTX "Python"
+ SSL_CTX_set_session_id_context(self->ctx, (const unsigned char *) SID_CTX,
+ sizeof(SID_CTX));
+#undef SID_CTX
+
return (PyObject *)self;
}