Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
b2ff768c
Commit
b2ff768c
authored
Mar 25, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test___example_servers pass undor 2.7.8 and 2.7.9 by ignoring self-signed cert validity
parent
65f57b0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
greentest/test___example_servers.py
greentest/test___example_servers.py
+16
-2
No files found.
greentest/test___example_servers.py
View file @
b2ff768c
...
...
@@ -8,19 +8,28 @@ else:
import
util
import
ssl
class
Test_wsgiserver
(
util
.
TestServer
):
server
=
'wsgiserver.py'
URL
=
'http://127.0.0.1:8088'
not_found_message
=
'<h1>Not Found</h1>'
ssl_ctx
=
None
def
read
(
self
,
path
=
'/'
):
url
=
self
.
URL
+
path
try
:
response
=
urllib2
.
urlopen
(
url
)
if
self
.
ssl_ctx
is
not
None
:
response
=
urllib2
.
urlopen
(
url
,
context
=
self
.
ssl_ctx
)
else
:
response
=
urllib2
.
urlopen
(
url
)
except
urllib2
.
HTTPError
:
response
=
sys
.
exc_info
()[
1
]
return
'%s %s'
%
(
response
.
code
,
response
.
msg
),
response
.
read
()
result
=
'%s %s'
%
(
response
.
code
,
response
.
msg
),
response
.
read
()
# XXX: It looks like under PyPy this isn't directly closing the socket
# when SSL is in use. It takes a GC cycle to make that true.
response
.
close
()
return
result
def
_test_hello
(
self
):
status
,
data
=
self
.
read
(
'/'
)
...
...
@@ -37,6 +46,11 @@ class Test_wsgiserver_ssl(Test_wsgiserver):
server
=
'wsgiserver_ssl.py'
URL
=
'https://127.0.0.1:8443'
if
hasattr
(
ssl
,
'_create_unverified_context'
):
# Disable verification for our self-signed cert
# on Python >= 2.7.9 and 3.4
ssl_ctx
=
ssl
.
_create_unverified_context
()
class
Test_webproxy
(
Test_wsgiserver
):
server
=
'webproxy.py'
...
...
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