Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5a2c0401
Commit
5a2c0401
authored
Mar 12, 2014
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20896: Workaround the bug temporarely to fix buildbots
parent
a0fe1f74
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Lib/test/test_ssl.py
Lib/test/test_ssl.py
+4
-3
No files found.
Lib/test/test_ssl.py
View file @
5a2c0401
...
...
@@ -1351,12 +1351,13 @@ class NetworkedTests(unittest.TestCase):
def
test_get_server_certificate
(
self
):
def
_test_get_server_certificate
(
host
,
port
,
cert
=
None
):
with
support
.
transient_internet
(
host
):
pem
=
ssl
.
get_server_certificate
((
host
,
port
))
# FIXME: force PROTOCOL_SSLv23 for workaround bug #20896
pem
=
ssl
.
get_server_certificate
((
host
,
port
),
ssl_version
=
ssl
.
PROTOCOL_SSLv23
)
if
not
pem
:
self
.
fail
(
"No server certificate on %s:%s!"
%
(
host
,
port
))
try
:
pem
=
ssl
.
get_server_certificate
((
host
,
port
),
ca_certs
=
CERTFILE
)
pem
=
ssl
.
get_server_certificate
((
host
,
port
),
ca_certs
=
CERTFILE
,
ssl_version
=
ssl
.
PROTOCOL_SSLv23
)
except
ssl
.
SSLError
as
x
:
#should fail
if
support
.
verbose
:
...
...
@@ -1364,7 +1365,7 @@ class NetworkedTests(unittest.TestCase):
else
:
self
.
fail
(
"Got server certificate %s for %s:%s!"
%
(
pem
,
host
,
port
))
pem
=
ssl
.
get_server_certificate
((
host
,
port
),
ca_certs
=
cert
)
pem
=
ssl
.
get_server_certificate
((
host
,
port
),
ca_certs
=
cert
,
ssl_version
=
ssl
.
PROTOCOL_SSLv23
)
if
not
pem
:
self
.
fail
(
"No server certificate on %s:%s!"
%
(
host
,
port
))
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