Yeela Kaplan has uploaded a new change for review.
Change subject: json cli: use ssl when creating a socket
......................................................................
json cli: use ssl when creating a socket
We want to be compatible with xmlrpc cli using regular ssl,
instead of current m2crypto.
Change-Id: I2fa15584eed90945cdf2eb8cad17ed7697678932
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/utils.py
M lib/yajsonrpc/stompreactor.py
2 files changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/11/45611/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index b7818eb..6f65275 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -1255,12 +1255,14 @@
return count * size
-def create_connected_socket(host, port, sslctx=None, timeout=None):
+def create_connected_socket(host, port, sslctx=None, timeout=None, m2c=True):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if sslctx:
- if _m2cEnabled:
+ if _m2cEnabled and m2c:
sock = SSL.Connection(sslctx.context)
else:
+ if _m2cEnabled:
+ import ssl
sock = ssl.wrap_socket(sock,
keyfile=sslctx.key_file,
certfile=sslctx.cert_file,
diff --git a/lib/yajsonrpc/stompreactor.py b/lib/yajsonrpc/stompreactor.py
index 7b63525..c9e8062 100644
--- a/lib/yajsonrpc/stompreactor.py
+++ b/lib/yajsonrpc/stompreactor.py
@@ -558,7 +558,8 @@
thread.setDaemon(True)
thread.start()
- client = StompClient(utils.create_connected_socket(host, port, sslctx),
+ client = StompClient(utils.create_connected_socket(host, port,
+ sslctx, m2c=False),
reactor)
jsonclient = JsonRpcClient(
--
To view, visit
https://gerrit.ovirt.org/45611
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fa15584eed90945cdf2eb8cad17ed7697678932
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>