mhaas / fbwlan

A simple, easy social wlan hotspot. Exchange internet access for Facebook check-ins
GNU Affero General Public License v3.0
107 stars 56 forks source link

No valid answer from the central server #30

Closed Langstra closed 7 years ago

Langstra commented 7 years ago

After setting up fbwlan on my server (shared hosting) and installing and configuring Wifidog, the captive portal worked and my requests were intercepted. I get redirected to the fbwlan page, I enter the access code and press to connect. Then I am redirect back to http://192.168.1.1:2060/wifidog/auth?token=a352c1d3d98f33e0ab7a0209540279d8bb6c5ad0 and the following message appears. Error: We did not get a valid answer from the central server

I then started Wifidog with wifidog -f -d 7 to get all the debugging. I found the following things that are of interest, but I am unsure where the problem lies. Could you help with this? I am interested in the techniques as well and would like to add some functionality later as well.

Maybe useful to know, the webserver uses https and I tried both wifidog configurations with sslavailable true and false.

[7][Wed Jun 21 12:48:54 2017][5284](centralserver.c:312) Level 1: Connecting to auth server wifi.schutterstoernooi.nl:80
[7][Wed Jun 21 12:48:54 2017][5284](centralserver.c:341) Level 1: Successfully connected to auth server wifi.schutterstoernooi.nl:80
[7][Wed Jun 21 12:48:54 2017][5284](centralserver.c:158) Unlocking config
[7][Wed Jun 21 12:48:54 2017][5284](centralserver.c:158) Config unlocked
[7][Wed Jun 21 12:48:54 2017][5284](centralserver.c:164) Connected to auth server
[6][Wed Jun 21 12:48:54 2017][5284](wd_util.c:116) AUTH_ONLINE status became ON
[7][Wed Jun 21 12:48:54 2017][5284](simple_http.c:77) Sending HTTP request to auth server: [GET /ping/?gw_id=default&sys_uptime=2353&sys_memfree=33488&sys_load=0.01&wifidog_uptime=1 HTTP/1.0
User-Agent: WiFiDog 1.3.0
Host: wifi.schutterstoernooi.nl

]

[7][Wed Jun 21 12:48:54 2017][5284](simple_http.c:87) Reading response
[7][Wed Jun 21 12:48:54 2017][5284](simple_http.c:111) Read 719 bytes
[7][Wed Jun 21 12:48:54 2017][5284](simple_http.c:124) HTTP Response from Server: [HTTP/1.1 301 Moved Permanently
Date: Wed, 21 Jun 2017 12:48:54 GMT
Server: Apache
Location: https://wifi.schutterstoernooi.nl/ping/?gw_id=default&sys_uptime=2353&sys_memfree=33488&sys_load=0.01&wifidog_uptime=1
Content-Length: 417
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://wifi.schutterstoernooi.nl/ping/?gw_id=default&amp;sys_uptime=2353&amp;sys_memfree=33488&amp;sys_load=0.01&amp;wifidog_uptime=1">here</a>.</p>
<hr>
<address>Apache Server at wifi.schutterstoernooi.nl Port 80</address>
</body></html>
]
[4][Wed Jun 21 12:48:54 2017][5284](ping_thread.c:191) Auth server did NOT say Pong!
[7][Wed Jun 21 12:48:54 2017][5284](firewall.c:139) Marking auth server down
[7][Wed Jun 21 12:50:54 2017][5284](simple_http.c:77) Sending HTTP request to auth server: [GET /auth/?stage=counters&ip=192.168.1.150&mac=54:ee:75:34:91:02&token=a352c1d3d98f33e0ab7a0209540279d8bb6c5ad0&incoming=0&outgoing=0&gw_id=default HTTP/1.0
User-Agent: WiFiDog 1.3.0
Host: wifi.schutterstoernooi.nl

]

[7][Wed Jun 21 12:50:54 2017][5284](simple_http.c:87) Reading response
[7][Wed Jun 21 12:50:54 2017][5284](simple_http.c:111) Read 843 bytes
[7][Wed Jun 21 12:50:54 2017][5284](simple_http.c:124) HTTP Response from Server: [HTTP/1.1 301 Moved Permanently
Date: Wed, 21 Jun 2017 12:50:54 GMT
Server: Apache
Location: https://wifi.schutterstoernooi.nl/auth/?stage=counters&ip=192.168.1.150&mac=54:ee:75:34:91:02&token=a352c1d3d98f33e0ab7a0209540279d8bb6c5ad0&incoming=0&outgoing=0&gw_id=default
Content-Length: 483
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://wifi.schutterstoernooi.nl/auth/?stage=counters&amp;ip=192.168.1.150&amp;mac=54:ee:75:34:91:02&amp;token=a352c1d3d98f33e0ab7a0209540279d8bb6c5ad0&amp;incoming=0&amp;outgoing=0&amp;gw_id=default">here</a>.</p>
<hr>
<address>Apache Server at wifi.schutterstoernooi.nl Port 80</address>
</body></html>
]
[6][Wed Jun 21 12:50:54 2017][5284](firewall.c:295) Checking client 192.168.1.150 for timeout:  Last updated 1498049385 (69 seconds ago), timeout delay 300 seconds, current time 1498049454, 
[7][Wed Jun 21 12:50:54 2017][5284](firewall.c:318) Locking client list
[7][Wed Jun 21 12:50:54 2017][5284](firewall.c:318) Client list locked
[4][Wed Jun 21 12:50:54 2017][5284](firewall.c:373) Error communicating with auth server - leaving 192.168.1.150 as-is for now
databeille commented 7 years ago

Please try HTTP protocol (stop redirection to HTTPS) and tell us if it is better.

Langstra commented 7 years ago

That definitely did the trick. Many thanks. Later I will look into this and see if we can use https as well.

databeille commented 7 years ago

Wifidog can deal with HTTPS. Please have a look to wifidog-gateway to learn how to do it: https://github.com/wifidog/wifidog-gateway

henok400 commented 4 years ago

i got similar error openwrt v19.07 and wifidog v1.3.1-4 if i use config HTTPS SSLAvailable yes the error occurred. This error must be fix . Please wifidog developers or other groups fix this issue.

AuthServer {
Hostname wan.cloudwifizone.com
HTTPPort 80
SSLAvailable yes
Path /
}