stefan-kaestle / openhab2-addons

Add-ons for openHAB 2.x
Eclipse Public License 2.0
16 stars 1 forks source link

Handle change of Home Controller system password correctly #55

Closed coeing closed 3 years ago

coeing commented 3 years ago

A change of SHC "system password" is an issue and happening also during initial setup of the binding e.g. if the wrong password was used instead of the App password.

See also comments in openhabCommunity.

The current solution is to *delete the /etc/oss_openhabbinding.jks file in your openhab installation** because the binding will recreate the jks file.

TODO from BoschSslUtil.java:

                // TODO if SHC system password is changed the keystore can't be loaded and an IOException "... password
                // was incorrect" is thrown
                // Either use a different secret instead of the system password (e.g. openHAB UUID?)
                // or recreate a new keystore with the different system password again (needs pairing)

In the meantime the initial pull request is discussed and from comments we can use "reference" code from openhab core how certificate handling is done there. See CertificateGenerator.java and the generateCertificate() function how the password, and self singed cert creation is done.

With this reference we should get rid of password problems, by using a single fixed password ins the code and avoid at least the bcprov-jdk15on bundle dependency, which increases the jar size a lot.

coeing commented 3 years ago

@GerdZanker I think this is fixed with your last pull request, isn't it?

GerdZanker commented 3 years ago

Yes, its avoided with PR #70, because the keystore password is now a static password defined in code. The BoschSHC systempassword is only used for pairing.

Drawback: A new keystore will be created using your SHC IP address and a new pairing is needed.