localhost:433... failed connection refused.

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
P6Mole
Posts: 8
Joined: Thursday 09 November 2017 13:06
Target OS: Windows
Domoticz version:
Contact:

localhost:433... failed connection refused.

Post by P6Mole »

Guys,

I am very new to this idea of port forwarding, in fact I have just watched a youtube video done by what sounded like an 8yr old lad making it sound simple, well I`m clueless and in need of help.

I am unsure if I have a router problem, a Domoticz problem or I`m just not doing it right.

When I run wget localhost:8080 all loks good however when I run the same for 433 I get what you can see below.

pi@raspberrypi:~ $ wget localhost:433
--2017-12-30 23:29:36-- http://localhost:433/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:433... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:433... failed: Connection refused.

Within my Plusnet router I have setup portforwarding from and to 433 for both UDP and TCP

My Domoticz.sh file looks like the below.

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Domoticz Home Automation System"
NAME=domoticz
USERNAME=pi
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

DAEMON=/home/$USERNAME/domoticz/$NAME
DAEMON_ARGS="-daemon"
#DAEMON_ARGS="$DAEMON_ARGS -daemonname $NAME -pidfile $PIDFILE"
DAEMON_ARGS="$DAEMON_ARGS -www 8080"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 433"
#DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"
#DAEMON_ARGS="$DAEMON_ARGS -syslog"

In my explorer I type HTTP://192.***.***.***:8080 and I can access Domoticz
If I type HTTPS://192.***.***.***:8080 I get

This site can’t provide a secure connection
192.***.***.*** sent an invalid response.
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR

which I suspect is correct.
If I type HTTPS://192.***.***.***:433 I get

This site can’t be reached
192.***.***.*** refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

I`m hoping that this is enough for someone to point me in the right direction.

Regards,

Ben
Jzjr
Posts: 14
Joined: Monday 05 October 2015 15:00
Target OS: Linux
Domoticz version: 4.10717
Location: UK
Contact:

Re: localhost:433... failed connection refused.

Post by Jzjr »

You could try using a different port number such as 9443 or any port above 1024, change this in 'Domoticz.sh'.

Extra permissions are required to use ports below 1024 on many Linux systems.

If you are set on using port 443 someone else should be able to point you in the right direction.
-
Fred Boniface

- Dell Optiplex 390 - Ubuntu Linux 18.04.01 LTS - Aeotec Z-Wave USB - RFXtrx433 - Hue Hub 2 - LGTV Plugin -
Hue Bulbs in every room, Temp Sensors on each floor, Temp-Monitoring Fridge, LightWaveRF 'Mood Switches'
helzing
Posts: 2
Joined: Sunday 06 March 2016 10:28
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.4834
Location: Arnhem
Contact:

Re: localhost:433... failed connection refused.

Post by helzing »

Hello P6Mole,

There is a typo in your domoticz.sh file, the correct port for SSL should be 443.

And you can then reach it by HTTPS://192.***.***.***

Succes
P6Mole
Posts: 8
Joined: Thursday 09 November 2017 13:06
Target OS: Windows
Domoticz version:
Contact:

Re: localhost:433... failed connection refused.

Post by P6Mole »

Gents,

Ive tried 8443 and 443 (with the corrections now made) and I get the below.

pi@raspberrypi:~ $ wget https://127.0.0.1:443
--2017-12-31 16:23:15-- https://127.0.0.1/
Connecting to 127.0.0.1:443... connected.
ERROR: The certificate of ‘127.0.0.1’ is not trusted.
ERROR: The certificate of ‘127.0.0.1’ hasn't got a known issuer.
The certificate's owner does not match hostname ‘127.0.0.1’

Its still the same when using my web browser (chrome) on my windows laptop and my android phone.

Any further help would be much appreciated.

Ben
helzing
Posts: 2
Joined: Sunday 06 March 2016 10:28
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.4834
Location: Arnhem
Contact:

Re: localhost:433... failed connection refused.

Post by helzing »

You have a connection, only the SSL cert is invalid, you can add an exeption in your browser.

Have a look at the Domoticz wiki page:

http://www.domoticz.com/wiki/Native_HTTPS_/_SSL_support

Regards,
Henk
P6Mole
Posts: 8
Joined: Thursday 09 November 2017 13:06
Target OS: Windows
Domoticz version:
Contact:

Re: localhost:433... failed connection refused.

Post by P6Mole »

Well gents,

thanks for your help, I have sorted the issue out.

By editing the Domoticz.sh file within my Domoticz folder I achieved nothing.
When I looked into my Domoticz log it was still looking for port 443 which was in use by something else.
When I changed the port within the Domoticz.sh file init.d folder the changes took effect and I can now log in vie HTTPS.

Cheers

Ben
User avatar
Sjonnie2017
Posts: 363
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: localhost:433... failed connection refused.

Post by Sjonnie2017 »

Excellent thread! Kudos to Ben for his follow up. Helped me a lot.

I found out there is yet another location where the port numbers for Domoticz are stored. It is located at /etc/domoticz. The file is called setupVars.conf and only holds the port numbers for HTTP and HTTPS. I needed to change the port number for HTTP since that has to be used by my PiHole. So changed the port number for HTTP for Domoticz in all three files. Now my PiHole can use port 80 without Domoticz interfering :)

Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests