openhab / openhab-vscode

VS Code extension for openHAB configuration files
https://marketplace.visualstudio.com/items?itemName=openhab.openhab
Eclipse Public License 2.0
159 stars 47 forks source link

hostname is not used completely (FQDN) #213

Closed CWempe closed 3 years ago

CWempe commented 3 years ago

According to gabbegubben it looks like the extension only takes the hostname from the openhab.host parameter instead of the FQDN.

His example:

{
    "openhab.host": "https://openhab.internal.mydomain.com",
    "openhab.port": 443,
    "openhab.username": "openhab",
    "openhab.password": "supersecretpassword",
    "openhab.useRestApi": true
}

The error:

Error while connecting to openHAB REST API. Hostname/IP does not match certificate's altnames: Host: openhab. is not in the cert's altnames: DNS:openhab.internal.mydomain.com

I have not tested this myself and I do not see any easy explanation for this here.

gabbe commented 3 years ago

Apparently the error message about the certificate not matching the hostname was a red herring due to my request URI being malformed. In my SUPERSECRET password I had characters that needed to be encoded.

I opened a pull request with the fix, please advice if I messed up somehow.