Dear all,
The error code 401 seems to be the HTTP status code 401 Unauthorized.
Domoticz replies HTTP 401 Unauthorized if your credentials are missing or erroneous, or the authentication request does not respect the Domoticz API.
Domoticz v2.3941 works using the default ssl arguments and Domotix v1.1.0. It also works when I use custom ssl arguments.
DomotiX uses the Login page API to login to the Domoticz server by send the request "/json.htm?param=logincheck&rememberme=true&type=command" :
Code: Select all
pi@raspberrypi ~/domoticz_test_2 $ sudo ./domoticz_test_2 -sslwww 10443
2016-03-09 23:51:07.941 Domoticz V3.4931 (c)2012-2016 GizMoCuz
2016-03-09 23:51:07.942 Build Hash: 8ede143-modified, Date: 2016-03-09 16:44:24
2016-03-09 23:51:07.942 System: Raspberry Pi
2016-03-09 23:51:07.942 Startup Path: /home/pi/domoticz_test_2/
2016-03-09 23:51:08.007 Sunrise: 07:16:00 SunSet:18:45:00
2016-03-09 23:51:08.007 EventSystem: reset all events...
2016-03-09 23:51:08.022 Active notification subsystems: (0/11)
2016-03-09 23:51:08.024 [web:8080] create server using settings : 'server_settings[is_secure_=false, listening_address='::', listening_port='8080']'
2016-03-09 23:51:08.025 WebServer(HTTP) started on address: :: with port 8080
2016-03-09 23:51:08.032 [web:10443] create ssl_server using ssl_server_settings : ssl_server_settings['server_settings[is_secure_=true, listening_address='::', listening_port='10443']', ssl_method='sslv23', certificate_chain_file_path='./server_cert.pem', ca_cert_file_path='./server_cert.pem', cert_file_path=./server_cert.pem', private_key_file_path='./server_cert.pem', private_key_pass_phrase='', options='default_workarounds,no_sslv2,single_dh_use', tmp_dh_file_path='./server_cert.pem', verify_peer=false, verify_fail_if_no_peer_cert=false, verify_file_path='']
2016-03-09 23:51:08.039 [web:10443] 'BEGIN DH PARAMETERS' found in file ./server_cert.pem
2016-03-09 23:51:08.040 WebServer(SSL) started on address: :: with port 10443
2016-03-09 23:51:08.045 Proxymanager started.
2016-03-09 23:51:08.048 Starting shared server on: :::10144
2016-03-09 23:51:08.048 TCPServer: shared server started...
2016-03-09 23:51:08.049 RxQueue: queue worker started...
2016-03-09 23:51:10.050 Domoticz Internal: Started
2016-03-09 23:51:10.051 EventSystem: reset all events...
2016-03-09 23:51:10.053 EventSystem: reset all device statuses...
2016-03-09 23:51:10.055 EventSystem: Started
2016-03-09 23:51:17.076 Incoming connection from: DOMOTIX_IP_ADDR
2016-03-09 23:51:17.269 [web:10443] no password (remote address: DOMOTIX_IP_ADDR)
2016-03-09 23:51:17.271 ::ffff:DOMOTIX_IP_ADDR -> "GET /json.htm?param=logincheck&password=d41d8cd98f00b204e9800998ecf8427e&rememberme=true&type=command&username= HTTP/1.1" 200 24
2016-03-09 23:51:17.386 [web:10443] no password (remote address: DOMOTIX_IP_ADDR)
2016-03-09 23:51:17.387 ::ffff:DOMOTIX_IP_ADDR -> "GET /json.htm?param=logincheck&password=d41d8cd98f00b204e9800998ecf8427e&rememberme=true&type=command&username= HTTP/1.1" 200 24
2016-03-09 23:51:17.391 [web:10443] no password (remote address: DOMOTIX_IP_ADDR)
2016-03-09 23:51:17.392 ::ffff:DOMOTIX_IP_ADDR -> "GET /json.htm?param=getauth&type=command HTTP/1.1" 200 95
2016-03-09 23:51:17.474 [web:10443] no password (remote address: DOMOTIX_IP_ADDR)
2016-03-09 23:51:17.475 ::ffff:DOMOTIX_IP_ADDR -> "GET /json.htm?param=getauth&type=command HTTP/1.1" 200 95
2016-03-09 23:51:17.483 [web:10443] no password (remote address: DOMOTIX_IP_ADDR)
2016-03-09 23:51:17.497 ::ffff:DOMOTIX_IP_ADDR -> "GET /json.htm?type=settings HTTP/1.1" 200 1254
2016-03-09 23:51:17.560 [web:10443] no password (remote address: DOMOTIX_IP_ADDR)
To access DomotiCZ without crashing DomotiX you only need valid credentials (empty user or password works if Domoticz allows it) and at least one switch.