Skip to content

Commit

Permalink
More logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kaithar committed Mar 6, 2018
1 parent 57e1fb2 commit d05ab46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion muhubot/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,23 @@ def _connect(self):
self.socket.identity = iden

while True:
self.log("Requesting port")
self.log("Loading socket")
qsock = self.context.socket(zmq.REQ)
client_secret_file = os.path.join(self.keys_dir, "client.key_secret")
self.log("Loading cert")
client_public, client_secret = zmq.auth.load_certificate(client_secret_file)
qsock.curve_secretkey = client_secret
qsock.curve_publickey = client_public

server_public_file = os.path.join(self.keys_dir, "server.key")
self.log("Loading cert 2")
server_public, _ = zmq.auth.load_certificate(server_public_file)
# The client must know the server's public key to make a CURVE connection.
qsock.curve_serverkey = server_public
qsock.set(zmq.LINGER, 1)
self.log("Connecting")
qsock.connect(self.endpoint.format("5141"))
self.log("Requesting port")
qsock.send(b'')
if qsock.poll(timeout=10000):
port = int(qsock.recv())
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(
name="muhubot",
version="0.0.3",
version="0.0.4",
packages=find_packages(include=['muhubot']),
namespace_packages=['muhubot']
)

0 comments on commit d05ab46

Please sign in to comment.