scratch_link.py, gencert.sh: Separate certification and private key

Now gencert.sh generates private key and certificate for the Secure WSS
server in a single file. This is not good to automate certification
addition to NSS databases. Generate them separately into two files and
initialize the Secure WSS server specifying them.

Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
This commit is contained in:
Shin'ichiro Kawasaki
2020-04-18 17:48:28 +09:00
parent f0bf6e1a6a
commit 8c42fc04b7
2 changed files with 10 additions and 5 deletions

View File

@@ -529,8 +529,9 @@ class BLESession(Session):
# kick start WSS server
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
localhost_pem = pathlib.Path(__file__).with_name("scratch-device-manager.pem")
ssl_context.load_cert_chain(localhost_pem)
localhost_cer = pathlib.Path(__file__).with_name("scratch-device-manager.cer")
localhost_key = pathlib.Path(__file__).with_name("scratch-device-manager.key")
ssl_context.load_cert_chain(localhost_cer, localhost_key)
sessionTypes = { '/scratch/ble': BLESession, '/scratch/bt': BTSession }
async def ws_handler(websocket, path):