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
e32467cf
Kaydet (Commit)
e32467cf
authored
Ara 06, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
allow ssl module to compile if openssl doesn't support SSL 3 (closes #22935)
Patch by Kurt Roeckx.
üst
81f01fb1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
8 deletions
+24
-8
test_ftplib.py
Lib/test/test_ftplib.py
+1
-1
test_ssl.py
Lib/test/test_ssl.py
+16
-7
NEWS
Misc/NEWS
+3
-0
_ssl.c
Modules/_ssl.c
+4
-0
No files found.
Lib/test/test_ftplib.py
Dosyayı görüntüle @
e32467cf
...
...
@@ -889,7 +889,7 @@ class TestTLS_FTPClass(TestCase):
def
test_auth_ssl
(
self
):
try
:
self
.
client
.
ssl_version
=
ssl
.
PROTOCOL_SSLv3
self
.
client
.
ssl_version
=
ssl
.
PROTOCOL_SSLv
2
3
self
.
client
.
auth
()
self
.
assertRaises
(
ValueError
,
self
.
client
.
auth
)
finally
:
...
...
Lib/test/test_ssl.py
Dosyayı görüntüle @
e32467cf
...
...
@@ -2168,20 +2168,24 @@ else:
sys
.
stdout
.
write
(
" SSL2 client to SSL23 server test unexpectedly failed:
\n
%
s
\n
"
%
str
(
x
))
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
True
)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
True
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv23
,
True
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_TLSv1
,
True
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
True
,
ssl
.
CERT_OPTIONAL
)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
True
,
ssl
.
CERT_OPTIONAL
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv23
,
True
,
ssl
.
CERT_OPTIONAL
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_TLSv1
,
True
,
ssl
.
CERT_OPTIONAL
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
True
,
ssl
.
CERT_REQUIRED
)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
True
,
ssl
.
CERT_REQUIRED
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv23
,
True
,
ssl
.
CERT_REQUIRED
)
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_TLSv1
,
True
,
ssl
.
CERT_REQUIRED
)
# Server with specific SSL options
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
False
,
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv3
,
False
,
server_options
=
ssl
.
OP_NO_SSLv3
)
# Will choose TLSv1
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv23
,
True
,
...
...
@@ -2191,6 +2195,8 @@ else:
@skip_if_broken_ubuntu_ssl
@unittest.skipUnless
(
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
),
"OpenSSL is compiled without SSLv3 support"
)
def
test_protocol_sslv3
(
self
):
"""Connecting to an SSLv3 server with various client options"""
if
support
.
verbose
:
...
...
@@ -2218,7 +2224,8 @@ else:
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1
,
ssl
.
PROTOCOL_TLSv1
,
True
,
ssl
.
CERT_REQUIRED
)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv2'
):
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1
,
ssl
.
PROTOCOL_SSLv2
,
False
)
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1
,
ssl
.
PROTOCOL_SSLv3
,
False
)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1
,
ssl
.
PROTOCOL_SSLv3
,
False
)
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1
,
ssl
.
PROTOCOL_SSLv23
,
False
,
client_options
=
ssl
.
OP_NO_TLSv1
)
...
...
@@ -2233,7 +2240,8 @@ else:
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1_1
,
ssl
.
PROTOCOL_TLSv1_1
,
True
)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv2'
):
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1_1
,
ssl
.
PROTOCOL_SSLv2
,
False
)
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1_1
,
ssl
.
PROTOCOL_SSLv3
,
False
)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1_1
,
ssl
.
PROTOCOL_SSLv3
,
False
)
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1_1
,
ssl
.
PROTOCOL_SSLv23
,
False
,
client_options
=
ssl
.
OP_NO_TLSv1_1
)
...
...
@@ -2255,7 +2263,8 @@ else:
client_options
=
ssl
.
OP_NO_SSLv3
|
ssl
.
OP_NO_SSLv2
,)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv2'
):
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1_2
,
ssl
.
PROTOCOL_SSLv2
,
False
)
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1_2
,
ssl
.
PROTOCOL_SSLv3
,
False
)
if
hasattr
(
ssl
,
'PROTOCOL_SSLv3'
):
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1_2
,
ssl
.
PROTOCOL_SSLv3
,
False
)
try_protocol_combo
(
ssl
.
PROTOCOL_TLSv1_2
,
ssl
.
PROTOCOL_SSLv23
,
False
,
client_options
=
ssl
.
OP_NO_TLSv1_2
)
...
...
Misc/NEWS
Dosyayı görüntüle @
e32467cf
...
...
@@ -215,6 +215,9 @@ Tests
Build
-----
-
Issue
#
22935
:
Allow
the
ssl
module
to
be
compiled
if
openssl
doesn
't support
SSL 3.
- Issue #16537: Check whether self.extensions is empty in setup.py. Patch by
Jonathan Hosmer.
...
...
Modules/_ssl.c
Dosyayı görüntüle @
e32467cf
...
...
@@ -2016,8 +2016,10 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
else
if
(
proto_version
==
PY_SSL_VERSION_TLS1_2
)
ctx
=
SSL_CTX_new
(
TLSv1_2_method
());
#endif
#ifndef OPENSSL_NO_SSL3
else
if
(
proto_version
==
PY_SSL_VERSION_SSL3
)
ctx
=
SSL_CTX_new
(
SSLv3_method
());
#endif
#ifndef OPENSSL_NO_SSL2
else
if
(
proto_version
==
PY_SSL_VERSION_SSL2
)
ctx
=
SSL_CTX_new
(
SSLv2_method
());
...
...
@@ -4065,8 +4067,10 @@ PyInit__ssl(void)
PyModule_AddIntConstant
(
m
,
"PROTOCOL_SSLv2"
,
PY_SSL_VERSION_SSL2
);
#endif
#ifndef OPENSSL_NO_SSL3
PyModule_AddIntConstant
(
m
,
"PROTOCOL_SSLv3"
,
PY_SSL_VERSION_SSL3
);
#endif
PyModule_AddIntConstant
(
m
,
"PROTOCOL_SSLv23"
,
PY_SSL_VERSION_SSL23
);
PyModule_AddIntConstant
(
m
,
"PROTOCOL_TLSv1"
,
...
...
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