Skip to content

Commit

Permalink
CherryPy working now
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrenstein committed Dec 8, 2023
1 parent 069ff07 commit 6a4ba53
Show file tree
Hide file tree
Showing 3 changed files with 271 additions and 293 deletions.
7 changes: 5 additions & 2 deletions SourceCode/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@ def main(use_existing_cert: bool):
" it's possible the generated cert will be lost!")
generate.generate_cert(os.uname()[1])

# Configure SSL
ssl_config = BuiltinSSLAdapter(certificate='/cert/server.crt', private_key='/cert/server.key',
certificate_chain=None)
# Configure CherryPy on 0.0.0.0:8443
server = WSGIServer(
('0.0.0.0', 8443), flask_app,
server_name=os.getenv("NETWORK_NAME", default="ZTA-" + os.uname()[1]))
# Configure CherryPy to use OpenSSL with TLS 1.2
server.ssl_adapter = BuiltinSSLAdapter('/cert/server.crt', '/cert/server.key', None)
# Configure CherryPy to use SSL
server.ssl_adapter = ssl_config
logging.info("Starting the server")
server.start()

Expand Down
Loading

0 comments on commit 6a4ba53

Please sign in to comment.