aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/transport/tls_cert.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-03 16:20:23 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-03 16:20:28 +0200
commit753653b4df62723b82d32799825135822886eac7 (patch)
tree14829922bf343e6353093eaceaa84986fe5f84df /packages/meshbay-node/src/meshbay_node/transport/tls_cert.py
parent675beed6ff688733a9598f9d82d41578f48316be (diff)
downloadmeshbay-753653b4df62723b82d32799825135822886eac7.tar.gz
refactor(node): platform abstraction for Windows portability (W1-W2-W5-W6-W7)
Platform directories, signal handling, chmod guards, ffmpeg discovery, and platform-conditional CLI messages โ€” all testable on Linux. See docs/WINDOWS-PORT.md ยง5 for the plan these implement. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/transport/tls_cert.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/transport/tls_cert.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/transport/tls_cert.py b/packages/meshbay-node/src/meshbay_node/transport/tls_cert.py
index 374fd08..8d680ea 100644
--- a/packages/meshbay-node/src/meshbay_node/transport/tls_cert.py
+++ b/packages/meshbay-node/src/meshbay_node/transport/tls_cert.py
@@ -21,10 +21,12 @@ from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid import NameOID
+from meshbay_node.platform import chmod_private, config_dir
+
log = logging.getLogger(__name__)
-DEFAULT_CERT = Path.home() / ".config" / "meshbay" / "node_tls.crt"
-DEFAULT_KEY = Path.home() / ".config" / "meshbay" / "node_tls.key"
+DEFAULT_CERT = config_dir() / "node_tls.crt"
+DEFAULT_KEY = config_dir() / "node_tls.key"
def generate_self_signed_cert(
@@ -64,8 +66,8 @@ def generate_self_signed_cert(
serialization.PrivateFormat.TraditionalOpenSSL,
serialization.NoEncryption(),
))
- cert_path.chmod(0o644)
- key_path.chmod(0o600)
+ chmod_private(cert_path, mode=0o644)
+ chmod_private(key_path)
log.info("TLS cert generated: %s", cert_path)
return cert_path, key_path