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

No connection to ioBroker when admin is using https #533

Open
baranator opened this issue Dec 5, 2024 · 2 comments
Open

No connection to ioBroker when admin is using https #533

baranator opened this issue Dec 5, 2024 · 2 comments
Labels

Comments

@baranator
Copy link

I wanted to have a look into the node-red adapter and installed it from stable repo. Version 5.x did not work at all complaining about an undefined util.log function and went into a restart-loop.

After installing the newest version 6.0.1 i got the adapter running and got access to the node-red webinterface. Unfortunately I am not able to access the iobroker object tree when configuring the nodes. When i click on the button next to the topic-field, nothing happens. On the developer-console of my browser i get the following message:

The page at 'https://192.168.1.11:8079/#flow/4568c66082a20b69' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://192.168.1.11:8081/?sid=1733429532375&name=node-red'. This request has been blocked; this endpoint must be available over WSS.

I noticed that allthough i've defined node-red and the admin-interface to use https, the websocket-endpoint is reported as ws:// instead of 'wss://'.

This seems to happen, as in line 95 of #src-object-selector/public/socket.iob.js the url used to create the socket is set prioritizing the _url-parameter (which starts with http) over the window.href.location (which has the needed https-prefix as i access the webinterface via https). As a quick and dirty hack for my case i hardcoded the wss in line 128. Alternatively you could modify line 95 to always take the window.href.location as the url. As i assume there was a reason for that conditional expression opened this issue to inform you about this bug discuss a proper fix for this.

@GermanBluefox
Copy link
Contributor

You should understand, that it is not possible to establish insecure socket connection from HTTPS to WS.
So it i not possible to communicate from HTTPS/node-red to ws/admin.
In this case the value of _url is right.

You case could be solved just be restarting of node-red, as node-red reads only at start where to find the admin.

@GermanBluefox
Copy link
Contributor

Now the node-red will be restarted automatically if admin settings changed

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