Skip to content

Commit

Permalink
Merge pull request #1242 from bersace/ssl
Browse files Browse the repository at this point in the history
Configure SSL ciphers
  • Loading branch information
bersace authored Aug 30, 2023
2 parents 04cf720 + dd8b9ae commit 66a071e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Ensure you use consistent title format.
- Fix logging on light terminal.
- Pin minor version of Python dependency in debian packages.
- Remove dependency on distutils.
- Disable 3DES and other loose SSL algorithmes.


**UI changes**
Expand Down
22 changes: 19 additions & 3 deletions agent/temboardagent/web/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,26 @@ def setup(self):
logger.debug(
"Using SSL certificate %s.",
self.app.config.temboard.ssl_cert_file)
self.server.socket = ssl.wrap_socket(
ctx = ssl.SSLContext()
ctx.load_cert_chain(
self.app.config.temboard.ssl_cert_file,
self.app.config.temboard.ssl_key_file,
)
ctx.set_ciphers(':'.join([
# From Mozilla SSL configuration generator. 2023-07-28
'ECDHE-ECDSA-AES128-GCM-SHA256',
'ECDHE-RSA-AES128-GCM-SHA256',
'ECDHE-ECDSA-AES256-GCM-SHA384',
'ECDHE-RSA-AES256-GCM-SHA384',
'ECDHE-ECDSA-CHACHA20-POLY1305',
'ECDHE-RSA-CHACHA20-POLY1305',
'DHE-RSA-AES128-GCM-SHA256',
'DHE-RSA-AES256-GCM-SHA384',
'DHE-RSA-CHACHA20-POLY1305',
]))

self.server.socket = ctx.wrap_socket(
self.server.socket,
keyfile=self.app.config.temboard.ssl_key_file,
certfile=self.app.config.temboard.ssl_cert_file,
server_side=True,
)
except Exception as e:
Expand Down
12 changes: 12 additions & 0 deletions ui/temboardui/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,18 @@ def setup(self):
ssl_ctx = {
'certfile': config.temboard.ssl_cert_file,
'keyfile': config.temboard.ssl_key_file,
'ciphers': ':'.join([
# From Mozilla SSL configuration generator. 2023-07-28
'ECDHE-ECDSA-AES128-GCM-SHA256',
'ECDHE-RSA-AES128-GCM-SHA256',
'ECDHE-ECDSA-AES256-GCM-SHA384',
'ECDHE-RSA-AES256-GCM-SHA384',
'ECDHE-ECDSA-CHACHA20-POLY1305',
'ECDHE-RSA-CHACHA20-POLY1305',
'DHE-RSA-AES128-GCM-SHA256',
'DHE-RSA-AES256-GCM-SHA384',
'DHE-RSA-CHACHA20-POLY1305',
]),
}
server = AutoHTTPSServer(self.app.tornado_app, ssl_options=ssl_ctx)
else:
Expand Down

0 comments on commit 66a071e

Please sign in to comment.