Homatic SSL: CERTIFICATE_VERIFY_FAILED IP address mismatch

For the last couple of days I am working on the homegear / homematic integration without succes. Every time I get ssl errors

Homegear is running in docker and I can login and add devices. (ELV MAX)
Homeassistant runs in docker (same server).

Homegear logging seems to be oke

01/03/21 19:16:40.178 RPC Server (Port 2001): Info: Connection from ::ffff:192.168.2.32:50814 accepted. Client number: 25
01/03/21 19:16:40.179 RPC Server (Port 2001): Info: RPC server client id for client number 25 is: 13
01/03/21 19:16:40.181 RPC Server (Port 2001): Info: Client successfully authorized as user [dartheide] using basic authentication.
01/03/21 19:16:40.181 RPC Server (Port 2001): Info: Client number 25 is calling RPC method: getValue (1) Parameters:

In homeA I get the following error:

Logger: pyhomematic._hm
Source: /usr/local/lib/python3.8/site-packages/pyhomematic/_hm.py:387
First occurred: 19:16:39 (1 occurrences)
Last logged: 19:16:39

RPCFunctions.jsonRpcPost: Exception: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for ‘dartheide.local’. (_ssl.c:1124)>[/code]

and if I use the Ipnumber in stead of the servername the error message is

RPCFunctions.jsonRpcPost: Exception: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: IP address mismatch, certificate is not valid for ‘192.168.2.32’. (_ssl.c:1124)>[/code]

I am ussing the following integration

#ELV MAX cube gateway
homematic:
local_ip: 192.168.2.32
local_port: 36845
interfaces:
wireless:
host: dartheide.local
port: 2001
callback_ip: 192.168.2.32
callback_port: 36845
resolvenames: json
username: dartheide
password: geheim

I have already renewed the certificates, but that did not help.
https://doc.homegear.eu/homegear/installation.html

Anyone an idea how I can fix this?

That’s probably a bug in pyhomematic. When SSL-validation is not explicitly enabled, it should automatically not validate certificates. But it looks like it does. I have created an issue here.

That being said, Homegear does not provide the API-endpoint to use resolvenames: json. As described here, you have to use metadata when using Homegear. So your error is just a side-effect, not the actual problem.

Thanks for your answer, I set resolvenames to metadata and it is working.