]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
vici: Fix connecting to socket in Python bindings on Windows
authorTobias Brunner <tobias@strongswan.org>
Thu, 31 Aug 2023 09:39:52 +0000 (11:39 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 31 Aug 2023 09:39:52 +0000 (11:39 +0200)
socket.connect() takes a single argument with the address that depends
on the address family, for TCP it's a tuple with IP and port.

Fixes: 00a75e332f29 ("vici: Create default TCP socket on Windows in Python bindings")
Closes strongswan/strongswan#1874

src/libcharon/plugins/vici/python/vici/session.py

index a031d12deaf34f1e7a005da939f407b062cee29e..a1f6f96b077c2ad4b7c182b5ae4280d83ff57a8e 100644 (file)
@@ -29,7 +29,7 @@ class Session(CommandWrappers, object):
         if sock is None:
             if platform.system() == "Windows":
                 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-                sock.connect('127.0.0.1', 4502)
+                sock.connect(('127.0.0.1', 4502))
             else:
                 sock = socket.socket(socket.AF_UNIX)
                 sock.connect("/var/run/charon.vici")