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
23df483c
Kaydet (Commit)
23df483c
authored
Agu 04, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Try to fix issue #9415: skip some tests on broken Ubuntu OpenSSL
üst
15cee620
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
test_ssl.py
Lib/test/test_ssl.py
+23
-0
No files found.
Lib/test/test_ssl.py
Dosyayı görüntüle @
23df483c
...
...
@@ -16,6 +16,7 @@ import traceback
import
asyncore
import
weakref
import
platform
import
functools
from
http.server
import
HTTPServer
,
SimpleHTTPRequestHandler
...
...
@@ -66,6 +67,20 @@ def no_sslv2_implies_sslv3_hello():
return
ssl
.
OPENSSL_VERSION_INFO
>=
(
0
,
9
,
7
,
8
,
15
)
# Issue #9415: Ubuntu hijacks their OpenSSL and forcefully disables SSLv2
def
skip_if_broken_ubuntu_ssl
(
func
):
@functools.wraps
(
func
)
def
f
(
*
args
,
**
kwargs
):
try
:
ssl
.
SSLContext
(
ssl
.
PROTOCOL_SSLv2
)
except
ssl
.
SSLError
:
if
(
ssl
.
OPENSSL_VERSION_INFO
==
(
0
,
9
,
8
,
15
,
15
)
and
platform
.
linux_distribution
()
==
(
'debian'
,
'squeeze/sid'
,
''
)):
raise
unittest
.
SkipTest
(
"Patched Ubuntu OpenSSL breaks behaviour"
)
return
func
(
*
args
,
**
kwargs
)
return
f
class
BasicSocketTests
(
unittest
.
TestCase
):
def
test_constants
(
self
):
...
...
@@ -176,6 +191,7 @@ class BasicSocketTests(unittest.TestCase):
class
ContextTests
(
unittest
.
TestCase
):
@skip_if_broken_ubuntu_ssl
def
test_constructor
(
self
):
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_SSLv2
)
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_SSLv23
)
...
...
@@ -185,6 +201,7 @@ class ContextTests(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
ssl
.
SSLContext
,
-
1
)
self
.
assertRaises
(
ValueError
,
ssl
.
SSLContext
,
42
)
@skip_if_broken_ubuntu_ssl
def
test_protocol
(
self
):
for
proto
in
PROTOCOLS
:
ctx
=
ssl
.
SSLContext
(
proto
)
...
...
@@ -197,6 +214,7 @@ class ContextTests(unittest.TestCase):
with
self
.
assertRaisesRegexp
(
ssl
.
SSLError
,
"No cipher can be selected"
):
ctx
.
set_ciphers
(
"^$:,;?*'dorothyx"
)
@skip_if_broken_ubuntu_ssl
def
test_options
(
self
):
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
# OP_ALL is the default value
...
...
@@ -938,6 +956,7 @@ else:
class
ThreadedTests
(
unittest
.
TestCase
):
@skip_if_broken_ubuntu_ssl
def
test_echo
(
self
):
"""Basic test of an SSL client connecting to a server"""
if
support
.
verbose
:
...
...
@@ -1040,6 +1059,7 @@ else:
finally
:
t
.
join
()
@skip_if_broken_ubuntu_ssl
def
test_protocol_sslv2
(
self
):
"""Connecting to an SSLv2 server with various client options"""
if
support
.
verbose
:
...
...
@@ -1060,6 +1080,7 @@ else:
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv2
,
ssl
.
PROTOCOL_SSLv23
,
True
,
client_options
=
ssl
.
OP_NO_TLSv1
)
@skip_if_broken_ubuntu_ssl
def
test_protocol_sslv23
(
self
):
"""Connecting to an SSLv23 server with various client options"""
if
support
.
verbose
:
...
...
@@ -1094,6 +1115,7 @@ else:
server_options
=
ssl
.
OP_NO_TLSv1
)
@skip_if_broken_ubuntu_ssl
def
test_protocol_sslv3
(
self
):
"""Connecting to an SSLv3 server with various client options"""
if
support
.
verbose
:
...
...
@@ -1109,6 +1131,7 @@ else:
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv3
,
ssl
.
PROTOCOL_SSLv23
,
True
,
client_options
=
ssl
.
OP_NO_SSLv2
)
@skip_if_broken_ubuntu_ssl
def
test_protocol_tlsv1
(
self
):
"""Connecting to a TLSv1 server with various client options"""
if
support
.
verbose
:
...
...
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