Community discussions

MikroTik App
 
spire2z
Long time Member
Long time Member
Topic Author
Posts: 517
Joined: Mon Feb 14, 2005 2:48 am

Any way to make all hotspot pages SSL.

Wed Mar 31, 2010 7:56 pm

In testing only the login screen loads up with SSL, status page etc don't by default. Is there a way to force all hotspot pages to SSL?
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: Any way to make all hotspot pages SSL.

Wed Mar 31, 2010 8:00 pm

Yes, but it's up to you to edit everything so that the links point to the right protocol in the URI.
 
spire2z
Long time Member
Long time Member
Topic Author
Posts: 517
Joined: Mon Feb 14, 2005 2:48 am

Re: Any way to make all hotspot pages SSL.

Wed Mar 31, 2010 8:14 pm

but just say someone just types into the browser address bar when they are logged in:

hotspot.myhost.com

Without any protocol info entered by default the page loads non ssl. I didn't know about anything in the html that controls that, surely it's the web server that does that? Or maybe you can enlighten me?

Thanks in advance..
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: Any way to make all hotspot pages SSL.

Wed Mar 31, 2010 8:21 pm

I see what you mean now. No, you cannot do that. The built in webserver/servlets don't support rewrites like that.

You can kind of fudge things out, though. From the manual:
request for "/" on the HotSpot host
* if user is logged in, rstatus.html is displayed; if rstatus.html is not found, redirect.html is used to redirect to the status page
So you can replace the content of rstatus.html with a meta redirect to https://hotspot.myhotspot.com/real_status.html, and add a file real_status.html to the Hotspot directory. That way, whether the request comes in via HTTPS or HTTP, the user will be redirected to an HTTPS page.

If someone goes to http://hotspot.myhotspot.com/real_status.html that will still load non-SSL, though.
 
spire2z
Long time Member
Long time Member
Topic Author
Posts: 517
Joined: Mon Feb 14, 2005 2:48 am

Re: Any way to make all hotspot pages SSL.

Thu Apr 01, 2010 1:57 am

That's great, thanks. I guess I should have read the manual properly :-0 But you saved me having to do that, and for that I send my thanks :-)
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: Any way to make all hotspot pages SSL.

Thu Apr 01, 2010 8:16 am

Set this between the <head></head> tags of any page you want HTTPS only:

Ex. status.html
$(if server-address == '<router ip>:80')
<meta http-equiv="refresh" content="0; url=https://<router ip>/status">
$(endif)
In my case, my router's IP is 192.168.101.1 To redirect any http request to https for the status page, here is my status.html:
<html>
<head>
$(if server-address == '192.168.101.1:80')
<meta http-equiv="refresh" content="0; url=https://192.168.101.1/status">
$(endif)
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>

<body>
You should now be viewing this STATUS page on an HTTPS connection.
</body>
</html>
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: Any way to make all hotspot pages SSL.

Thu Apr 01, 2010 7:54 pm

Nice.
Remember to pass on any GET or POST parameters if you replace pages that require them.
 
spire2z
Long time Member
Long time Member
Topic Author
Posts: 517
Joined: Mon Feb 14, 2005 2:48 am

Re: Any way to make all hotspot pages SSL.

Fri Apr 02, 2010 4:31 am

Yeah good one. that is better.
 
router22
just joined
Posts: 1
Joined: Fri Apr 02, 2010 5:51 pm
Contact:

Re: Any way to make all hotspot pages SSL.

Fri Apr 02, 2010 6:04 pm

Set this between the <head></head> tags of any page you want HTTPS only:

Ex. status.html
$(if server-address == '<router ip>:80')
<meta http-equiv="refresh" content="0; url=https://<router ip>/status">
$(endif)
In my case, my router's IP is 192.168.101.1 To redirect any http request to https for the status page, here is my status.html:
<html>
<head>
$(if server-address == '192.168.101.1:80')
<meta http-equiv="refresh" content="0; url=https://192.168.101.1/status">
$(endif)
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>

<body>
You should now be viewing this STATUS page on an HTTPS connection.
</body>
</html>
Thx, was having the same issue and appreciate the code.

Ken
“Life is a journey, not a destintion” Aerosmith
http://www.understandhairloss.org
 
tombee79
Member Candidate
Member Candidate
Posts: 247
Joined: Sun May 09, 2010 2:28 am

Re: Any way to make all hotspot pages SSL.

Tue Sep 07, 2010 7:56 am

You can not edit user manager html pages. So you can not use the SSL html code you proposed.

But the hot spot redirect option look ok. Must check that out.

thx
 
tombee79
Member Candidate
Member Candidate
Posts: 247
Joined: Sun May 09, 2010 2:28 am

Re: Any way to make all hotspot pages SSL.

Tue Sep 14, 2010 6:32 am

Is there any Firewall MT pro?


Can i do the trick with firewall filter ? Is it possible to check for domain name request and if that the request occurred trigger the address re-write to https?

or something like that, i am not good with firewall in MT.

Any advise?

thx
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: Any way to make all hotspot pages SSL.

Tue Sep 14, 2010 6:59 am

Here is some documentation describing more on customizing hotspot servlet pages (also applies to v4.x):
Customizing HotSpot: HTTP Servlet Pages

Hope this helps.
Doug
 
tombee79
Member Candidate
Member Candidate
Posts: 247
Joined: Sun May 09, 2010 2:28 am

Re: Any way to make all hotspot pages SSL.

Tue Sep 14, 2010 7:40 am

no thats not it.

I guess it problem got to do with http server that serves pages of itself and only him can check if the page should be server or its url re-writed or change protocal to https. But we dont' have control over http serve in MT rb.

At least for now.

thx btw

Who is online

Users browsing this forum: adamsen, sabnamtkgeeta and 111 guests