Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
a2b612c9
Commit
a2b612c9
authored
Nov 17, 2018
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'ssl/verify-ssl-paths'
parents
2422f782
c6a5ac7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
server.py
cps/server.py
+18
-8
No files found.
cps/server.py
View file @
a2b612c9
...
@@ -32,9 +32,14 @@ class server:
...
@@ -32,9 +32,14 @@ class server:
def
start_gevent
(
self
):
def
start_gevent
(
self
):
try
:
try
:
ssl_args
=
dict
()
ssl_args
=
dict
()
if
web
.
ub
.
config
.
get_config_certfile
()
and
web
.
ub
.
config
.
get_config_keyfile
():
certfile_path
=
web
.
ub
.
config
.
get_config_certfile
()
ssl_args
=
{
"certfile"
:
web
.
ub
.
config
.
get_config_certfile
(),
keyfile_path
=
web
.
ub
.
config
.
get_config_keyfile
()
"keyfile"
:
web
.
ub
.
config
.
get_config_keyfile
()}
if
certfile_path
and
keyfile_path
:
if
os
.
path
.
isfile
(
certfile_path
)
and
os
.
path
.
isfile
(
keyfile_path
):
ssl_args
=
{
"certfile"
:
certfile_path
,
"keyfile"
:
keyfile_path
}
else
:
web
.
app
.
logger
.
info
(
'The specified paths for the ssl certificate file and/or key file seem to be broken. Ignoring ssl. Cert path:
%
s | Key path:
%
s'
%
(
certfile_path
,
keyfile_path
))
if
os
.
name
==
'nt'
:
if
os
.
name
==
'nt'
:
self
.
wsgiserver
=
WSGIServer
((
'0.0.0.0'
,
web
.
ub
.
config
.
config_port
),
web
.
app
,
spawn
=
Pool
(),
**
ssl_args
)
self
.
wsgiserver
=
WSGIServer
((
'0.0.0.0'
,
web
.
ub
.
config
.
config_port
),
web
.
app
,
spawn
=
Pool
(),
**
ssl_args
)
else
:
else
:
...
@@ -60,12 +65,17 @@ class server:
...
@@ -60,12 +65,17 @@ class server:
self
.
start_gevent
()
self
.
start_gevent
()
else
:
else
:
try
:
try
:
ssl
=
None
web
.
app
.
logger
.
info
(
'Starting Tornado server'
)
web
.
app
.
logger
.
info
(
'Starting Tornado server'
)
if
web
.
ub
.
config
.
get_config_certfile
()
and
web
.
ub
.
config
.
get_config_keyfile
():
certfile_path
=
web
.
ub
.
config
.
get_config_certfile
()
ssl
=
{
"certfile"
:
web
.
ub
.
config
.
get_config_certfile
(),
keyfile_path
=
web
.
ub
.
config
.
get_config_keyfile
()
"keyfile"
:
web
.
ub
.
config
.
get_config_keyfile
()}
if
certfile_path
and
keyfile_path
:
else
:
if
os
.
path
.
isfile
(
certfile_path
)
and
os
.
path
.
isfile
(
keyfile_path
):
ssl
=
None
ssl
=
{
"certfile"
:
certfile_path
,
"keyfile"
:
keyfile_path
}
else
:
web
.
app
.
logger
.
info
(
'The specified paths for the ssl certificate file and/or key file seem to be broken. Ignoring ssl. Cert path:
%
s | Key path:
%
s'
%
(
certfile_path
,
keyfile_path
))
# Max Buffersize set to 200MB
# Max Buffersize set to 200MB
http_server
=
HTTPServer
(
WSGIContainer
(
web
.
app
),
http_server
=
HTTPServer
(
WSGIContainer
(
web
.
app
),
max_buffer_size
=
209700000
,
max_buffer_size
=
209700000
,
...
...
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