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
ae80f450
Commit
ae80f450
authored
Mar 12, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use ssl.PROTOCOL_SSLv23 for maximum compatibility (closes #20896)
parent
4bb5d783
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
Lib/test/test_ssl.py
Lib/test/test_ssl.py
+8
-3
No files found.
Lib/test/test_ssl.py
View file @
ae80f450
...
...
@@ -390,19 +390,24 @@ class NetworkedTests(unittest.TestCase):
def
test_get_server_certificate
(
self
):
with
test_support
.
transient_internet
(
"svn.python.org"
):
pem
=
ssl
.
get_server_certificate
((
"svn.python.org"
,
443
))
pem
=
ssl
.
get_server_certificate
((
"svn.python.org"
,
443
),
ssl
.
PROTOCOL_SSLv23
)
if
not
pem
:
self
.
fail
(
"No server certificate on svn.python.org:443!"
)
try
:
pem
=
ssl
.
get_server_certificate
((
"svn.python.org"
,
443
),
ca_certs
=
CERTFILE
)
pem
=
ssl
.
get_server_certificate
((
"svn.python.org"
,
443
),
ssl
.
PROTOCOL_SSLv23
,
ca_certs
=
CERTFILE
)
except
ssl
.
SSLError
:
#should fail
pass
else
:
self
.
fail
(
"Got server certificate %s for svn.python.org!"
%
pem
)
pem
=
ssl
.
get_server_certificate
((
"svn.python.org"
,
443
),
ca_certs
=
SVN_PYTHON_ORG_ROOT_CERT
)
pem
=
ssl
.
get_server_certificate
((
"svn.python.org"
,
443
),
ssl
.
PROTOCOL_SSLv23
,
ca_certs
=
SVN_PYTHON_ORG_ROOT_CERT
)
if
not
pem
:
self
.
fail
(
"No server certificate on svn.python.org:443!"
)
if
test_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