From d5f29bd20fd01a5244a3d2e01f4e51e9dd1918ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 15 Jun 2021 13:32:22 +0200 Subject: [PATCH] Added ignore certificate for getting server stats on localhost --- server/src/uds/services/PhysicalMachines/service_multi.py | 5 +++++ tunnel-server/src/uds_tunnel/stats.py | 1 + 2 files changed, 6 insertions(+) diff --git a/server/src/uds/services/PhysicalMachines/service_multi.py b/server/src/uds/services/PhysicalMachines/service_multi.py index b1138213..15b13771 100644 --- a/server/src/uds/services/PhysicalMachines/service_multi.py +++ b/server/src/uds/services/PhysicalMachines/service_multi.py @@ -269,7 +269,12 @@ class IPMachinesService(IPServiceBase): IPMachineDeployed, userDeployment ) theIP = IPServiceBase.getIp(assignableId) + theMAC = IPServiceBase.getMac(assignableId) + if self.storage.readData(theIP) is None: self.storage.saveData(theIP, theIP) + if theMAC: + theIP += ';' + theMAC return userServiceInstance.assign(theIP) + return userServiceInstance.error('IP already assigned') diff --git a/tunnel-server/src/uds_tunnel/stats.py b/tunnel-server/src/uds_tunnel/stats.py index daa1c285..10ee7ee1 100644 --- a/tunnel-server/src/uds_tunnel/stats.py +++ b/tunnel-server/src/uds_tunnel/stats.py @@ -137,6 +137,7 @@ async def getServerStats(detailed: bool = False) -> None: # Context for local connection (ignores cert hostname) context = ssl.create_default_context() context.check_hostname = False + context.verify_mode = ssl.CERT_NONE # For ServerStats, do not checks certificate try: host = cfg.listen_address if cfg.listen_address != '0.0.0.0' else 'localhost'