From 02ea2c1d143de80358b9a3473b6c954ddfd14523 Mon Sep 17 00:00:00 2001 From: Justin Skywork Date: Mon, 23 Mar 2026 19:50:00 -0400 Subject: [PATCH] feat: implement mTLSTransport for secure agent communication #146 --- bindu/transport/security/mTLSTransport.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 bindu/transport/security/mTLSTransport.py diff --git a/bindu/transport/security/mTLSTransport.py b/bindu/transport/security/mTLSTransport.py new file mode 100644 index 00000000..54a82f00 --- /dev/null +++ b/bindu/transport/security/mTLSTransport.py @@ -0,0 +1,15 @@ +import ssl + +class mTLSTransport: + """ + mTLS Transport for secure agent-to-agent communication. + Ensures that only authorized agents can communicate in the Bindu network. + """ + def __init__(self, cert_path, key_path, ca_path): + self.context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) + self.context.load_cert_chain(certfile=cert_path, keyfile=key_path) + self.context.load_verify_locations(cafile=ca_path) + self.context.verify_mode = ssl.CERT_REQUIRED + + def wrap_socket(self, sock, server_side=False): + return self.context.wrap_socket(sock, server_side=server_side)