Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify the port to be used when running ha_bridge with https? #1376

Closed
BernieHD opened this issue Oct 19, 2022 · 7 comments
Closed
Labels

Comments

@BernieHD
Copy link

Is there a way to specify the port of HA_Bridge when running it via https? Or what port is used for https communication to the HA_Bridge?

I couldn't find any parameter related to the topic in the documentation....

@bwssytems
Copy link
Owner

No matter which type you are using i will be this setting:

https://github.com/bwssytems/ha-bridge#-dserverportport-number

@BernieHD
Copy link
Author

No matter which type you are using i will be this setting:

https://github.com/bwssytems/ha-bridge#-dserverportport-number

Hi,

Many thanks for the fast reply! Does this mean, that HA Bridge can either run on port 80 or on port 443?
And If I want HA Bridge to run on standard https, I have to specify it to run on port 443? Correct?

@bwssytems
Copy link
Owner

Have you reviewed the security config wiki section as well:

https://github.com/bwssytems/ha-bridge/wiki/Security-Configuration

@BernieHD
Copy link
Author

Have you reviewed the security config wiki section as well:

https://github.com/bwssytems/ha-bridge/wiki/Security-Configuration

Hi there,
Many thanks for your continued support! Yes I have read and followed the steps described in the Wiki with a self-signed certificate for usage of HA Bridge via https.
The result is that the webinterface of HA Bridge is not reachable any more after I switch https on.
https://<my_ha_bridge>/ => server not reachable
https://<my_ha_bridge>:80/ => server not reachable
http://<my_ha_bridge>/ => server not reachable

My above question if HA_Bridge always runs on a single port which would mean from my understanding that for standard https access via port 443 would require to specify port 443 in the settings is not answered yet....

@BernieHD
Copy link
Author

I played around a bit more with HA Bridge and its configuration file with the following discoveries:

  1. It seems not possible to configure HA Brdige's config file in a way that its web_server listens on another port than 80!
  2. When I change the calue of the port ion the "Bridge Control" page e.g. to 8080 the value gets not written to the configuration file. As a consequence the webserver port remains on 80 which seems the default.
  3. When I then stop the HA Bridge service on my RPI, open the configuration file and edit the webserver port parameter to e.g. 8080 and then save the file the value gets changed back to 80 when i start the HA Bridge servcie again and of course the webserver ist reachable on port 80!

@bwssytems, is there any way how I can change this in more detail? Even when i delete the configuration file, a new one gets generated with the defauzlt values in it. I can change in the configuration file the parameter which specifies the devices database but apparently not the webserver port!

Any idea?

@BernieHD
Copy link
Author

Sooo, ultimately I'm able to run my HA Bridge with https on port 443.

The trick is to

  1. follow above mentioned documentation and
  2. update after you have reconfigured HA Bridge to run on https the service file at /etc/systemd/system/habridge.service. In this service file the port is specified on which HA Bridge listens for requests after it is started.
  • So stoping HA Bridge after configuring it to run on https
  • Changing the port from 80 to 443 in the service file
  • Making systemctl to reload the updated service file
  • And restarting HA Bridge again

does the entire trick!

After that procedure I can access my HA Bridge at https://<ip_adress> under port 443 with my webbrowser.

However running HA Bridge on https does not at all fix the issue that Magenta Smart Home refuses to connect to HA Bridge. Here is what I fidured out so far:

  • When my HA Bridge runs on http and port 80 it is discovere dby Magenta Smart Home (MSH), but MSH can't connect to HA Bridge. MSH complains about the Link-Button not being pressed in time while it tried to connect
  • MSHs behaviour does not change wether or not the "Link-Button" is enabled on HA Bridge and pressed immediately before or after MSH is requested to connect to the "Hue Bridge" it found with my HA Bridge
  • After I enable HA Bridge to listen on https and on port 443 it is not discovered any more by MSH
  • Even if I try to connect HA Bridge manually to MSH it is not discovered if https on port 443 is enabled at HA Bridge

Conclusion:

  1. MSH does apparently NOT expect the Hue Bridge emulated by HA Bridge to run on https, port 443
  2. MSH seems to have an issue with the implementation of the Link-Butto on HA Brdige which blocks MSH to connect to HA Bridge

Anyone any guess or any idea?

@BernieHD
Copy link
Author

BernieHD commented Oct 31, 2022

As described, I managed to specify the port on which HA Bridge listens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants