Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
664c2d1f
Kaydet (Commit)
664c2d1f
authored
Kas 17, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #10443: Add the SSLContext.set_default_verify_paths() method.
üst
b6d4ee53
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
0 deletions
+29
-0
ssl.rst
Doc/library/ssl.rst
+9
-0
test_ssl.py
Lib/test/test_ssl.py
+6
-0
NEWS
Misc/NEWS
+2
-0
_ssl.c
Modules/_ssl.c
+12
-0
No files found.
Doc/library/ssl.rst
Dosyayı görüntüle @
664c2d1f
...
@@ -536,6 +536,15 @@ to speed up repeated connections from the same clients.
...
@@ -536,6 +536,15 @@ to speed up repeated connections from the same clients.
following an `OpenSSL specific layout
following an `OpenSSL specific layout
<http://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html>`_.
<http://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html>`_.
.. method:: SSLContext.set_default_verify_paths()
Load a set of default "certification authority" (CA) certificates from
a filesystem path defined when building the OpenSSL library. Unfortunately,
there's no easy way to know whether this method succeeds: no error is
returned if no certificates are to be found. When the OpenSSL library is
provided as part of the operating system, though, it is likely to be
configured properly.
.. method:: SSLContext.set_ciphers(ciphers)
.. method:: SSLContext.set_ciphers(ciphers)
Set the available ciphers for sockets created with this context.
Set the available ciphers for sockets created with this context.
...
...
Lib/test/test_ssl.py
Dosyayı görüntüle @
664c2d1f
...
@@ -412,6 +412,12 @@ class ContextTests(unittest.TestCase):
...
@@ -412,6 +412,12 @@ class ContextTests(unittest.TestCase):
'cache_full'
:
0
,
'cache_full'
:
0
,
})
})
def
test_set_default_verify_paths
(
self
):
# There's not much we can do to test that it acts as expected,
# so just check it doesn't crash or raise an exception.
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
ctx
.
set_default_verify_paths
()
class
NetworkedTests
(
unittest
.
TestCase
):
class
NetworkedTests
(
unittest
.
TestCase
):
...
...
Misc/NEWS
Dosyayı görüntüle @
664c2d1f
...
@@ -13,6 +13,8 @@ Core and Builtins
...
@@ -13,6 +13,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #10443: Add the SSLContext.set_default_verify_paths() method.
- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
Patch by Robert Collins.
Patch by Robert Collins.
...
...
Modules/_ssl.c
Dosyayı görüntüle @
664c2d1f
...
@@ -1783,6 +1783,16 @@ error:
...
@@ -1783,6 +1783,16 @@ error:
return
NULL
;
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
[]
=
{
static
PyGetSetDef
context_getsetlist
[]
=
{
{
"options"
,
(
getter
)
get_options
,
{
"options"
,
(
getter
)
get_options
,
(
setter
)
set_options
,
NULL
},
(
setter
)
set_options
,
NULL
},
...
@@ -1802,6 +1812,8 @@ static struct PyMethodDef context_methods[] = {
...
@@ -1802,6 +1812,8 @@ static struct PyMethodDef context_methods[] = {
METH_VARARGS
|
METH_KEYWORDS
,
NULL
},
METH_VARARGS
|
METH_KEYWORDS
,
NULL
},
{
"session_stats"
,
(
PyCFunction
)
session_stats
,
{
"session_stats"
,
(
PyCFunction
)
session_stats
,
METH_NOARGS
,
NULL
},
METH_NOARGS
,
NULL
},
{
"set_default_verify_paths"
,
(
PyCFunction
)
set_default_verify_paths
,
METH_NOARGS
,
NULL
},
{
NULL
,
NULL
}
/* sentinel */
{
NULL
,
NULL
}
/* sentinel */
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment