Remove SSL support

If there's a need for SSL, you can always use a reverse proxy or
a more advanced WSGI server.

This reverts commit 1678890d3d.
This commit is contained in:
flan
2017-10-28 05:50:18 +02:00
parent c398ccdb89
commit bd2c5bdff9
3 changed files with 8 additions and 22 deletions

View File

@@ -739,28 +739,20 @@ def make_app(global_conf, **local_conf):
return SyncApp(**local_conf)
def main():
from eventlet import wsgi,wrap_ssl,listen
from wsgiref.simple_server import make_server
from ankisyncd.thread import shutdown
config = SafeConfigParser()
config.read("ankisyncd.conf")
ankiserver = SyncApp(config)
host = config.get("sync_app", "host")
port = config.getint("sync_app", "port")
if(config.getboolean("sync_app", "ssl")):
certfile = config.get("sync_app", "certfile")
keyfile = config.get("sync_app", "keyfile")
socket = wrap_ssl( listen((host, port)),
certfile=certfile,
keyfile=keyfile,
server_side=True )
else:
socket = listen((host, port))
httpd = make_server('', config.getint("sync_app", "port"), ankiserver)
try:
wsgi.server(socket, ankiserver)
print "Starting..."
httpd.serve_forever()
except KeyboardInterrupt:
print "Exiting ..."
finally:
shutdown()