SSL Handshake failed and configure openHAB URL

So similar to other problems and more.

So, I had OH2.2 working well on my RPi2. Via raspi-config the hostname was set to “ExampleName1”.
And on my Fritz router, I also assigned the IP “X.X.X.X” to be assigned to “ExampleName1” too.
Everything was working fine.

Then, I put the same SD-card from RPi2 to my RPi3.
Everything worked as expected, no issues, except 2 new phenomena:

a) OpenHab Android App on 2 of my devices, gave me the SSL Handshake failed error.
If I ticked Ignore SSL hostname and Ignore SSL certificate, then I could connect, but it was bothering me.
I think if I used Clear User Data for the app, it would have worked.
Reference, Juice SSH was having the same problem. But JuiceSSH has a “clear all locally saved hostnames and keys” option.
Keep in mind, everything was finding my RPi3 as usual. All my IoT devices, MQTT, ESP8266 etc.

Using chrome to open http://ExampleName1:8080 still worked.

Anyway, being 2am, I went for a stupid solution. I changed the RPi3 hostname definition via Rapsi-Config, and via my router.
The IP X.X.X.X = ExampleName2.
I say it was stupid, because I had to change several lines of configuration files (mqtt.cfg, some html links, my ESP8266, etc).
I broke the concept of using hostnames (i.e. rather than using a hostname to not care about the IP).

Anyway, after changing to ExampleName2 - everything is working again.

Using chrome to open http://ExampleName2:8080 also worked.

But i noticed one more issue…
While outside of the house, I connected to my home VPN via my router.
When I do so, all SAMBA folders, Juice SSH, etc worked fine.
But Openhab Android App, could not find my OH2.
It kept saying, “Please check that openHAB is running or configure OpenHAB URL or remote URL”.

But this is weird, because using chrome to open http://ExampleName2:8080 also still works.
Next weird thing is, if I add the exact same URL (copied and pasted) to the remote address settings, it works fine.

So openhab Android app, is resolving hostnames in a unique way beyond Android OS’ way of resolving.
I.e. once it connects, it seems to save the IP = hostname somewhere (potentially also some security key based on the upper issue too).

Any ideas?
Of course, I can use the browser, but it negates the purpose of having an app.
I prefer the app due to the voice command options too.

Small addition, the following might be relevant too.

Within the house it is ExampleName2.local1
Via VPN it becomes ExampleName2.local2

so the local parent group name changes, but until now, it never was an issue because the router handles resolving the device hostname and managed it for any app / service used.
Even Ikea’s default Tradfri App worked over VPN (which is designed to only work over a local network).

Though I am generally very happy with the new application, I have some similar problems as you do:
It just refuses to ‘recognize’ when it is supposed to go ‘remote’ Keeps telling me it cant find openhab running.
However, when I remove the settings under the ‘local server settings’, it will immediately find the remote server.

Not an unsurmountable problem but definitely a nuisance

It is weird for me that now, no matter what, it always says that it is connecting to the local server…
Even when I am over VPN.
But without a remote setting, it will not connect at all.

It must be something about how it caches / saves / stores keys and IP association.