summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormeskio on windows <meskio@leap.se>2016-02-11 11:26:06 +0100
committerRuben Pollan <meskio@sindominio.net>2016-02-18 18:21:24 +0100
commita36fdc8ebec9c42c61a2c733ea280a3fa9103598 (patch)
tree17f30085e519a32365167cde96b16a10462ae5cf
parenta42d67584fa70abb59b932471b4df3606b8294d0 (diff)
[feat] Get events working on windows
Always use tcp channels and disable curve encryption on the zmq connections. - Closes: #7899, #7239 - Related: #7919
-rw-r--r--src/leap/common/events/server.py4
-rw-r--r--src/leap/common/zmq_utils.py5
2 files changed, 8 insertions, 1 deletions
diff --git a/src/leap/common/events/server.py b/src/leap/common/events/server.py
index a69202e..7126723 100644
--- a/src/leap/common/events/server.py
+++ b/src/leap/common/events/server.py
@@ -22,6 +22,7 @@ The server for the events mechanism.
import logging
+import platform
import txzmq
from leap.common.zmq_utils import zmq_has_curve
@@ -29,7 +30,8 @@ from leap.common.zmq_utils import zmq_has_curve
from leap.common.events.zmq_components import TxZmqServerComponent
-if zmq_has_curve():
+if zmq_has_curve() or platform.system() == "Windows":
+ # Windows doesn't have icp sockets, we need to use always tcp
EMIT_ADDR = "tcp://127.0.0.1:9000"
REG_ADDR = "tcp://127.0.0.1:9001"
else:
diff --git a/src/leap/common/zmq_utils.py b/src/leap/common/zmq_utils.py
index 0a781de..39a49c7 100644
--- a/src/leap/common/zmq_utils.py
+++ b/src/leap/common/zmq_utils.py
@@ -19,6 +19,7 @@ Utilities to handle ZMQ certificates.
"""
import os
import logging
+import platform
import stat
import shutil
@@ -52,6 +53,10 @@ def zmq_has_curve():
`zmq.auth` module is new in version 14.1
`zmq.has()` is new in version 14.1, new in version libzmq-4.1.
"""
+ if platform.system() == "Windows":
+ # TODO: curve is not working on windows #7919
+ return False
+
zmq_version = zmq.zmq_version_info()
pyzmq_version = zmq.pyzmq_version_info()