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

Why do you use http protocol for apple's captive website? #74

Closed
ProgrammingLife opened this issue Jun 2, 2020 · 4 comments
Closed

Comments

@ProgrammingLife
Copy link

Maybe it's better to use https version?
How often can I check isOnline status using this lib?

@sindresorhus
Copy link
Owner

@silverwind Do you remember why we use HTTP and not HTTPS for that?

@sindresorhus
Copy link
Owner

How often can I check isOnline status using this lib?

As often as you want, but if you check too often, you're just wasting resources.

@silverwind
Copy link
Collaborator

silverwind commented Jun 2, 2020

IIRC, the service did not support HTTPS when the check was implemented, but it seems it now does, so we should switch to it:

$ curl http://captive.apple.com/hotspot-detect.html
<HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>
$ curl https://captive.apple.com/hotspot-detect.html
<HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>

@silverwind
Copy link
Collaborator

On second thought, I think it's specifically using HTTP because router interception only works for HTTP, not HTTPS (it can not offer a valid certificate unless one is pre-installed on the machine).

Still I think using HTTPS should be preferred. With it, the check will fail at either the connection or certificate verification stage when not online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants