summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-11-17 20:29:42 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-11-17 20:29:42 (GMT)
commit664c2d1fc072d0cbd9b92a1cd5c9ac9ad7db326e (patch)
tree20115d0c90143e88464ca061a34fb9151e8ea50e /Modules
parentb6d4ee536174f2d467c195904c140025109242e7 (diff)
downloadcpython-664c2d1fc072d0cbd9b92a1cd5c9ac9ad7db326e.zip
cpython-664c2d1fc072d0cbd9b92a1cd5c9ac9ad7db326e.tar.gz
cpython-664c2d1fc072d0cbd9b92a1cd5c9ac9ad7db326e.tar.bz2
Issue #10443: Add the SSLContext.set_default_verify_paths() method.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ssl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 78ea293..c2b976a 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -1783,6 +1783,16 @@ error:
return NULL;
}
+static PyObject *
+set_default_verify_paths(PySSLContext *self, PyObject *unused)
+{
+ if (!SSL_CTX_set_default_verify_paths(self->ctx)) {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
static PyGetSetDef context_getsetlist[] = {
{"options", (getter) get_options,
(setter) set_options, NULL},
@@ -1802,6 +1812,8 @@ static struct PyMethodDef context_methods[] = {
METH_VARARGS | METH_KEYWORDS, NULL},
{"session_stats", (PyCFunction) session_stats,
METH_NOARGS, NULL},
+ {"set_default_verify_paths", (PyCFunction) set_default_verify_paths,
+ METH_NOARGS, NULL},
{NULL, NULL} /* sentinel */
};