[ihc] Support for TLSv1.2 (#10856)

* [ihc] Support for TLSv1.2

So far IHC controller have supported only TLSv1. As TLSv1 is already
deprecated and upcoming IHC controller FW version will introduce support
for TLSv1.2.

This change introduce TLSv1.2 support for the binding. TLS version is
selectable to be backward compatible for older controller versions.

Communication error handling is also improved e.g. because of wrong
password or if Java environment doesn't support required TLS version.
When fatal communication error occurs, binding will not hammer
controller with retries as it need user actions.

Signed-off-by: Pauli Anttila <pauli.anttila@gmail.com>

* [ihc] Introduced auto mode and other improvements

Signed-off-by: Pauli Anttila <pauli.anttila@gmail.com>

* [ihc] introduced default constant

Signed-off-by: Pauli Anttila <pauli.anttila@gmail.com>
This commit is contained in:
pali
2021-06-20 21:07:12 +03:00
committed by GitHub
parent 3d33ee0ab8
commit 61280ea4a2
9 changed files with 222 additions and 88 deletions

View File

@@ -20,14 +20,15 @@ This binding supports one ThingType: `controller`.
The `controller` Thing has the following configuration parameters:
| Parameter | Description | Required | Default value |
|-----------------------------|------------------------------------------------------------------------------------------------------------------------------|----------|---------------|
| hostname | Network/IP address of the IHC / ELKO controller without https prefix, but can contain TCP port if default port is not used. | yes | |
| username | User name to login to the IHC / ELKO controller. | yes | |
| password | Password to login to the IHC / ELKO controller. | yes | |
| timeout | Timeout in milliseconds to communicate to IHC / ELKO controller. | no | 5000 |
| loadProjectFile | Load project file from controller. | no | true |
| createChannelsAutomatically | Create channels automatically from project file. Project file loading parameter should be enabled as well. | no | true |
| Parameter | Description | Required | Default value |
|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------------|
| hostname | Network/IP address of the IHC / ELKO controller without https prefix, but can contain TCP port if default port is not used. | yes | |
| username | User name to login to the IHC / ELKO controller. | yes | |
| password | Password to login to the IHC / ELKO controller. | yes | |
| timeout | Timeout in milliseconds to communicate to IHC / ELKO controller. | no | 5000 |
| loadProjectFile | Load project file from controller. | no | true |
| createChannelsAutomatically | Create channels automatically from project file. Project file loading parameter should be enabled as well. | no | true |
| tlsVersion | TLS version used for controller communication. Choose `TLSv1` for older firmware versions and `TLSv1.2` for never versions (since fall 2021). `AUTO` mode try to recognize correct version. | no | TLSv1 |
## Channels
@@ -148,7 +149,7 @@ Will send TOGGLE (ON/OFF) command to Dimmer test item when short button press is
### example.things
```xtend
ihc:controller:elko [ hostname="192.168.1.2", username="openhab", password="secret", timeout=5000, loadProjectFile=true, createChannelsAutomatically=false ] {
ihc:controller:elko [ hostname="192.168.1.2", username="openhab", password="secret", timeout=5000, loadProjectFile=true, createChannelsAutomatically=false, tlsVersion="TLSv1" ] {
Channels:
Type switch : my_test_switch "My Test Switch" [ resourceId=3988827 ]
Type contact : my_test_contact "My Test Contact" [ resourceId=3988827 ]