From de405586e3b5b9d525b6c5ea30b64330fc676e52 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Tue, 8 Dec 2015 10:01:25 +0100 Subject: [PATCH] make certif 0o600 also. --- tools/secure_notebook.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/secure_notebook.py b/tools/secure_notebook.py index 90efe7cd0..4590e4388 100644 --- a/tools/secure_notebook.py +++ b/tools/secure_notebook.py @@ -56,8 +56,11 @@ def create_self_signed_cert(cert_dir, keyfile, certfile): with io.open(join(cert_dir, certfile), "wt") as f: f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert).decode('utf8')) + os.chmod(join(cert_dir, certfile), 0o600) + with io.open(join(cert_dir, keyfile), "wt") as f: f.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, k).decode('utf8')) + os.chmod(join(cert_dir, keyfile), 0o600)