Skip to main content

Apple CNA, Android Connectivity Check, Microsoft NCSI : Comment la détection de Captive Portal fonctionne réellement

Cette référence technique définitive explique comment Apple CNA, Android connectivitycheck et Microsoft NCSI détectent les Captive Portals. Elle fournit des conseils pratiques aux responsables informatiques et aux architectes réseau sur la configuration des jardins clos (walled garden), les modes de défaillance courants et les meilleures pratiques pour un déploiement fluide.

📖 5 min de lecture📝 1,178 mots🔧 2 exemples3 questions📚 8 termes clés

🎧 Écouter ce guide

Voir la transcription
Apple CNA, Android Connectivity Check, Microsoft NCSI: How Captive Portal Detection Actually Works A Purple WiFi Technical Briefing --- INTRODUCTION AND CONTEXT — approximately 1 minute Welcome to the Purple Technical Briefing series. I'm your host, and today we're getting into something that sits at the very heart of every guest WiFi deployment — captive portal detection. Specifically, we're looking at how Apple, Android, and Windows each decide, the moment a device joins your network, whether a captive portal is present and whether they should show it to the user. This matters enormously in practice. Get it wrong, and your guests connect to the network but never see the splash page. Or they see it twice. Or Windows loops endlessly on the sign-in prompt. These are real, recurring support tickets across hotels, stadiums, retail chains, and conference centres. And the root cause, almost every time, is a misconfigured walled garden or a misunderstanding of how these three OS families actually behave differently from one another. So let's get into it. --- TECHNICAL DEEP-DIVE — approximately 5 minutes Let's start with Apple, because Apple's Captive Network Assistant — the CNA — is probably the most widely discussed and the most frequently misunderstood. When an Apple device, whether that's an iPhone, iPad, or Mac, joins a new WiFi network, the operating system immediately fires off an HTTP GET request. On modern iOS and macOS, that probe goes to captive.apple.com, specifically the path /hotspot-detect.html. The device is expecting a very specific response: an HTTP 200 with a body that reads, verbatim, "Success" wrapped in basic HTML tags. If it gets that exact response, the OS concludes it has full internet access and does nothing further. No portal, no pop-up. But if the response is anything other than that — a redirect, a different body, a timeout — the CNA kicks in. It opens what Apple calls WebSheet, which is a sandboxed mini-browser. Not Safari. Not Chrome. A locked-down browser window that has no access to Safari extensions, cannot save passwords, and on macOS is fixed at roughly 900 pixels wide. This is important for portal designers: your splash page must render correctly in that constrained environment. Now here's the first critical nuance. The CNA probe is HTTP, not HTTPS. If your captive portal gateway intercepts that probe and redirects it to an HTTPS URL, the CNA will not handle it gracefully. The user will see a certificate warning, or the portal simply won't open. Your redirect must stay on HTTP port 80 for the initial probe interception. The second nuance: if your walled garden passthrough list includes captive.apple.com and allows it to reach the real Apple server, the device will get the genuine "Success" response, conclude it has internet, and never show the portal. This is a classic misconfiguration — operators add captive.apple.com to their passthrough list thinking they're helping, but they're actually bypassing their own portal. Apple has also been rolling out support for RFC 8910, the Captive Portal API, which uses DHCP option 114 to signal portal presence positively rather than relying on probe interception. iOS 16 and later support this. It's a cleaner mechanism, but it requires your DHCP server or access point to advertise the option — something most legacy deployments don't yet do. Now let's move to Android. Android's connectivity check works on a fundamentally different principle. Instead of expecting a specific body text in an HTTP 200 response, Android expects an HTTP 204 — that's 204 No Content. The primary probe URL is connectivitycheck.gstatic.com/generate_204. Secondary probes go to clients2.google.com/generate_204 and connectivitycheck.android.com. When Android fires that probe and receives a 204, it concludes: internet is available, no portal. When it receives anything else — a redirect, a 200 with content, a timeout — it flags the network as requiring sign-in and shows the user a notification: "Sign in to WiFi network." Tapping that notification opens the full Chrome browser, not a sandboxed mini-browser. This is a significant difference from Apple. Android users get the full browser experience, which means your portal can use JavaScript, cookies, and modern CSS without the constraints of CNA's WebSheet. The critical walled garden implication for Android: if you block connectivitycheck.gstatic.com entirely — don't allow it through at all — Android doesn't detect a captive portal. Instead, it shows "Connected, no internet." The user sees the WiFi icon with an exclamation mark and has no idea a portal exists. You must allow the probe URL through your walled garden but intercept it with a redirect rather than blocking it outright. Android 11 introduced support for RFC 7710 bis and the Captive Portal API via DHCP option 114, mirroring Apple's approach. If the DHCP handshake includes the API URL, Android fetches it immediately and prompts the user to log in. This is more reliable than probe interception, but again requires infrastructure support. Now, Windows. And this is where things get interesting, because Windows uses a dual-probe mechanism that trips up a lot of deployments. Windows Network Connectivity Status Indicator — NCSI — runs two checks simultaneously when a device joins a network. First, an HTTP probe: GET request to http://www.msftconnecttest.com/connecttest.txt, expecting a 200 response with the body text "Microsoft Connect Test". Second, a DNS probe: it resolves dns.msftncsi.com and expects a specific IPv6 address in response — fd3e:4f5a:5b81::1. If the HTTP probe is redirected, Windows detects a captive portal and opens the default browser — Edge, in modern deployments — pointing it at the portal URL. This part works fine. The problem is what happens after authentication. Here's the Windows looping scenario, which I see in support tickets regularly. User authenticates on the portal. The portal marks their MAC address as authorised. But Windows then re-runs its NCSI probes. If msftconnecttest.com is still being intercepted — perhaps because the gateway hasn't yet propagated the MAC authorisation — Windows concludes the portal is still active and opens the browser again. The user has to sign in a second time, or sometimes a third. This loop continues until the gateway correctly passes NCSI traffic for that client. The fix is straightforward but requires attention: ensure your gateway propagates MAC authorisation immediately and that post-auth traffic to msftconnecttest.com and dns.msftncsi.com passes through cleanly. Also worth noting: older Windows versions used www.msftncsi.com rather than msftconnecttest.com. If you're supporting Windows 7 or 8 clients — yes, they still exist in enterprise and public-sector environments — you need both domains in your walled garden. --- IMPLEMENTATION RECOMMENDATIONS AND PITFALLS — approximately 2 minutes Let me give you the practical implementation framework. Your walled garden — the list of hosts accessible before authentication — must cover all three OS probe sets. At minimum, that means: captive.apple.com and www.apple.com for Apple; connectivitycheck.gstatic.com, clients2.google.com, and connectivitycheck.android.com for Android; and www.msftconnecttest.com, dns.msftncsi.com, and www.msftncsi.com for Windows. Do not allow these hosts to reach their real destinations. Allow the DNS resolution to succeed, but intercept the HTTP traffic and redirect it to your portal. The distinction matters: DNS must resolve, HTTP must redirect. For the portal itself, always serve the initial redirect on HTTP port 80. Your portal login page can be HTTPS — and should be, for credential security — but the initial interception and redirect must happen over HTTP. Apple's CNA will not follow an HTTPS redirect. Test with all three OS families before go-live. The most common gap I see is teams testing on their own iPhones and declaring the portal working, without ever checking Windows or Android. A quick test matrix: iPhone on iOS 16+, Android on a stock Google device, and a Windows 10 or 11 laptop. Run each one, check that the portal appears, complete authentication, and verify the device shows full internet connectivity afterwards. If you're running a Purple WiFi deployment, the platform handles walled garden configuration automatically and maintains an updated host list as Apple, Google, and Microsoft update their probe endpoints. This matters because these URLs do change — Google has updated its probe URLs across Android versions, and Microsoft shifted from msftncsi.com to msftconnecttest.com in Windows 10. --- RAPID-FIRE Q AND A — approximately 1 minute Question: My Apple users see the portal on first connect but not on reconnect. Why? Answer: iOS caches the captive portal state per SSID. Once authenticated, the device remembers that network as "internet available." If you want to re-prompt on reconnect, you need to clear the MAC authorisation on your gateway, which forces the device to re-probe. Some venues do this on a timer — say, 24 hours — for daily re-authentication. Question: Android shows "Connected, no internet" even though the portal is working for Apple users. What's wrong? Answer: Your walled garden is blocking connectivitycheck.gstatic.com rather than redirecting it. Add it to your passthrough list but ensure the gateway intercepts and redirects the HTTP traffic. Question: Can I use HTTPS for my entire portal, including the initial redirect? Answer: No. The initial interception must be HTTP. You can redirect from HTTP to HTTPS for the login page itself, but the first redirect from the probe URL must be plaintext HTTP. Otherwise Apple CNA won't trigger, and users will see certificate warnings. --- SUMMARY AND NEXT STEPS — approximately 1 minute To wrap up: Apple CNA, Android Connectivity Check, and Microsoft NCSI are three distinct mechanisms with different probe URLs, different expected responses, and different failure modes. Apple expects HTTP 200 with a specific body. Android expects HTTP 204. Windows runs a dual HTTP and DNS probe and is vulnerable to post-auth looping if your gateway is slow to propagate authorisation. Your walled garden must cover all three probe sets. Your initial redirect must be HTTP. And you should test with all three OS families before any deployment goes live. If you want to go deeper on the RFC 8910 Captive Portal API — the future of this space — or on how Purple WiFi automates walled garden management across multi-vendor infrastructure, head to purple.ai. The Guest WiFi and WiFi Analytics documentation covers the full technical architecture. Thanks for listening. We'll be back with another technical briefing shortly.

header_image.png

Résumé Exécutif

La détection de Captive Portal est un composant essentiel mais souvent mal compris des réseaux d'entreprise. Lorsqu'un appareil se connecte à un réseau WiFi public, le système d'exploitation exécute une série de sondes en arrière-plan pour déterminer si l'accès à internet est disponible ou si un Captive Portal intercepte le trafic. Apple, Android et Windows utilisent chacun des mécanismes distincts, avec des URL de sonde, des réponses attendues et des modes de défaillance différents.

Pour les responsables informatiques et les architectes réseau qui déploient des solutions Guest WiFi dans les secteurs de l' Hôtellerie , du Commerce de détail ou du secteur public, une mauvaise configuration de ces mécanismes de détection entraîne des coûts de support importants. Les invités peuvent voir des avertissements de certificat, ne pas voir la page d'accueil ou rencontrer des boucles de connexion infinies. Ce guide de référence fournit l'architecture technique définitive d'Apple CNA, Android Connectivity Check et Microsoft NCSI, vous dotant des connaissances exploitables nécessaires pour construire des jardins clos (walled gardens) robustes et neutres vis-à-vis des fournisseurs, et garantir une expérience de connexion fluide.

Approfondissement Technique

Apple Captive Network Assistant (CNA)

Lorsqu'un appareil Apple (iOS ou macOS) se connecte à un réseau, il envoie immédiatement une requête HTTP GET à son URL de sonde principale : http://captive.apple.com/hotspot-detect.html. L'appareil s'attend à une réponse HTTP 200 OK avec un corps HTML spécifique contenant le mot "Success" [1].

Si la réponse correspond à cette attente, l'OS suppose un accès internet complet. Si la réponse est autre chose – comme une redirection HTTP 302 ou un timeout – l'OS déclenche le Captive Network Assistant (CNA). Le CNA ouvre WebSheet, un mini-navigateur en bac à sable (sandboxed) avec des fonctionnalités limitées (pas d'extensions Safari, pas de sauvegarde de mot de passe) [2].

Contrainte critique : La sonde initiale est HTTP. Si votre passerelle intercepte la sonde et redirige vers une URL HTTPS, le CNA échouera gracieusement, entraînant souvent un avertissement de certificat ou un écran vide. La redirection initiale doit rester sur le port HTTP 80. De plus, si vous autorisez par inadvertance captive.apple.com à travers votre jardin clos (walled garden), l'appareil atteindra le véritable serveur Apple, recevra la réponse "Success" et contournera entièrement votre portail.

Android Connectivity Check

Android fonctionne sur un principe différent. Sa sonde principale cible http://connectivitycheck.gstatic.com/generate_204 (avec des solutions de repli vers clients2.google.com et connectivitycheck.android.com). Au lieu d'attendre une réponse HTTP 200 avec un contenu spécifique, Android s'attend à une réponse HTTP 204 No Content [3].

Si Android reçoit un HTTP 204, il suppose une connectivité internet. S'il reçoit une redirection ou une réponse HTTP 200, il signale le réseau comme Captive et affiche une notification "Se connecter au réseau WiFi". Taper sur cette notification ouvre le navigateur Chrome complet, permettant une expérience de portail plus riche par rapport au CNA en bac à sable d'Apple.

Contrainte critique : Si votre jardin clos (walled garden) bloque entièrement connectivitycheck.gstatic.com au lieu de l'intercepter et de le rediriger, Android affichera un avertissement "Connecté, pas d'internet" et n'invitera pas l'utilisateur à se connecter.

Microsoft Network Connectivity Status Indicator (NCSI)

Windows utilise un mécanisme de double sonde via le service Network Connectivity Status Indicator (NCSI). Lors de la connexion, Windows effectue une requête HTTP GET vers http://www.msftconnecttest.com/connecttest.txt (s'attendant à une réponse 200 avec le texte "Microsoft Connect Test") et une résolution DNS pour dns.msftncsi.com [4].

Si la sonde HTTP est interceptée, Windows détecte le portail et ouvre le navigateur par défaut (Edge). Cependant, Windows est sujet à un problème de boucle post-authentification. Après que l'utilisateur s'est authentifié, Windows réexécute les sondes NCSI. Si la passerelle n'a pas encore propagé l'autorisation de l'adresse MAC, la sonde est de nouveau interceptée, et Windows rouvre le portail, forçant l'utilisateur dans une boucle de connexion.

os_detection_comparison.png

Guide d'Implémentation

Pour assurer une détection fiable des Captive Portals sur tous les appareils, vous devez configurer votre zone de pré-authentification (jardin clos / walled garden) pour gérer les exigences spécifiques de chaque OS.

walled_garden_architecture.png

Configuration du Jardin Clos (Walled Garden)

Votre jardin clos (walled garden) doit inclure les hôtes suivants. Il est crucial que vous interceptiez et redirigiez le trafic HTTP vers ces hôtes, plutôt que de simplement les laisser passer vers internet.

  • Apple : captive.apple.com, www.apple.com, www.appleiphonecell.com, www.itools.info
  • Android : connectivitycheck.gstatic.com, clients2.google.com, connectivitycheck.android.com
  • Windows : www.msftconnecttest.com, dns.msftncsi.com, www.msftncsi.com (pour les clients hérités)

Étapes de Déploiement

  1. Configurer la Résolution DNS : Assurez-vous que les requêtes DNS pour les URL de sonde se résolvent avec succès dans la zone de pré-authentification.
  2. Intercepter les Sondes HTTP : Configurez votre passerelle pour intercepter les requêtes HTTP GET vers les URL de sonde et renvoyer une redirection HTTP 302 vers la page d'accueil de votre portail.
  3. Maintenir HTTP pour la Redirection Initiale : La redirection initiale doit être servie via HTTP (port 80). Vous pouvez ensuite rediriger l'utilisateur vers une page de connexion HTTPS, mais le premier saut doit être en HTTP en texte clair pour satisfaire Apple CNA.
  4. Propager Rapidement l'Autorisation : Assurez-vous que votre passerelle met à jour immédiatement ses règles de pare-feu après une authentification réussie pour permettre aux sondes NCSI de passer, évitant ainsi les boucles Windows.

Bonnes Pratiques

  • Adoptez le RFC 8910 (Captive Portal API) : Les systèmes d'exploitation modernes (iOS 16+, Android 11+) prennent en charge l'option DHCP 114, qui fournit un signal positif de la présence d'un Captive Portal via une URL API désignée [5]. Cela élimine la dépendance à l'interception de sondes et constitue l'approche recommandée pour l'avenir.
  • Testez sur toutes les plateformes : Ne supposez jamais qu'un portail fonctionne uniquement sur la base de tests effectués avec un iPhone. Exigez une matrice de test incluant les appareils iOS, Android standard et Windows 10/11.
  • Utilisez des plateformes automatisées : La gestion manuelle des URL de sondes en constante évolution est sujette aux erreurs. Des plateformes comme Purple mettent automatiquement à jour les définitions de jardins clos à mesure qu'Apple, Google et Microsoft modifient leur infrastructure, garantissant une collecte de données WiFi Analytics cohérente.

Dépannage et atténuation des risques

Symptôme Cause première Résolution
Le CNA Apple ne s'ouvre pas ; l'utilisateur voit un avertissement SSL. La passerelle intercepte la sonde et redirige directement vers HTTPS. Assurez-vous que l'interception et la redirection initiales utilisent le port HTTP 80.
L'appareil Apple se connecte sans afficher le portail. captive.apple.com est autorisé à traverser le jardin clos vers Internet. Supprimez captive.apple.com de la liste d'autorisation ; assurez-vous qu'il est intercepté.
Android affiche « Connecté, pas d'internet ». connectivitycheck.gstatic.com est bloqué par le pare-feu. Autorisez l'URL de la sonde dans le jardin clos, mais interceptez-la et redirigez-la.
Windows invite l'utilisateur à se connecter plusieurs fois (boucle). La passerelle est lente à appliquer les règles MAC post-authentification ; le NCSI est toujours intercepté. Optimisez la propagation des règles de la passerelle ; assurez-vous que msftconnecttest.com passe après l'authentification.

ROI et impact commercial

Une architecture robuste de détection de Captive Portal a un impact direct sur les résultats. Dans un hôtel de 500 chambres ou un grand environnement de vente au détail, les échecs de Captive Portal génèrent un volume disproportionné de tickets de support informatique. En éliminant ces points de friction, les établissements réduisent les frais de support, améliorent les scores de satisfaction des clients et augmentent le taux de capture des données de première partie.

Lorsque les utilisateurs se connectent en toute transparence, ils interagissent avec vos pages d'accueil, ce qui vous permet de diffuser un marketing ciblé, de vous intégrer aux programmes de fidélité et de générer des revenus mesurables, comme détaillé dans notre guide sur le Système de positionnement intérieur : Guide UWB, BLE et WiFi . Pour les établissements opérant à l'international, un portail fiable garantit une collecte de données de conformité cohérente, soutenant les cadres discutés dans le LGPD brésilien et le WiFi invité : Un guide de conformité .


Références

[1] Assistance Apple, « Utiliser les réseaux Wi-Fi captifs sur votre iPhone ou iPad », 2024. [2] SecureW2, « Qu'est-ce que l'assistant de réseau captif Apple ? », 2023. [3] Développeurs Android, « Prise en charge de l'API Captive Portal », Fonctionnalités d'Android 11, 2020. [4] Microsoft Learn, « Détection de Captive Portal et expérience utilisateur dans Windows », Développeur de matériel Windows, 2025. [5] IETF, « RFC 8910 : Identification de Captive Portal dans DHCP et les annonces de routeur », 2020.

Termes clés et définitions

Captive Network Assistant (CNA)

Apple's built-in mechanism for detecting captive portals and displaying them in a sandboxed mini-browser (WebSheet) rather than the full Safari browser.

IT teams must ensure their splash pages are responsive and do not rely on advanced browser features, as the CNA environment is highly constrained.

Network Connectivity Status Indicator (NCSI)

The Windows service responsible for determining internet connectivity by probing specific Microsoft domains via HTTP and DNS.

Understanding NCSI is critical for preventing the common 'Windows looping' issue where users are repeatedly prompted to sign in.

Walled Garden

A restricted network environment that allows unauthenticated users access to a specific list of approved hostnames or IP addresses.

Properly configuring the walled garden is the foundation of captive portal deployment, ensuring OS probes are handled correctly.

HTTP 204 No Content

An HTTP status code indicating the server successfully processed the request but is not returning any content.

This is the specific response Android devices expect from `connectivitycheck.gstatic.com` to confirm full internet access.

RFC 8910 (Captive Portal API)

An IETF standard that uses DHCP option 114 to explicitly notify a device of a captive portal's presence and provide the portal URL.

This modern standard replaces unreliable probe interception and is supported by newer versions of iOS and Android.

WebSheet

The sandboxed, limited-functionality mini-browser used by Apple's CNA to render captive portal splash pages.

Portal designers must test their pages in WebSheet, as it lacks features like password saving and full cookie support found in standard browsers.

MAC Authorisation

The process by which a gateway grants network access to a specific device based on its Media Access Control address after successful portal authentication.

Delays in applying MAC authorisation cause post-authentication probes (like Windows NCSI) to fail, leading to poor user experiences.

Probe Interception

The technique of capturing an operating system's background connectivity check and forcibly redirecting it to a captive portal login page.

This is the legacy, yet most common, method for triggering captive portals, requiring precise HTTP 302 redirects.

Études de cas

A 300-room hotel reports that guests using iPhones are connecting to the guest WiFi but are not being prompted with the captive portal splash page. Android and Windows users are unaffected.

  1. Review the walled garden (pre-authentication) allowlist on the gateway.
  2. Identify that captive.apple.com has been added as a permitted passthrough host.
  3. Remove captive.apple.com from the passthrough list.
  4. Configure the gateway to intercept HTTP requests to captive.apple.com and redirect them (via HTTP 302) to the portal URL.
Notes de mise en œuvre : This is a classic misconfiguration. By allowing `captive.apple.com` to reach the internet, the Apple device receives the expected 'Success' response and assumes no portal is present. Removing it forces the interception required to trigger the CNA.

A conference centre's IT team receives complaints that Windows 11 users are authenticating successfully but are immediately prompted to sign in again, creating an endless loop.

  1. Verify that the captive portal gateway is successfully authorising the client's MAC address post-authentication.
  2. Inspect the post-authentication firewall rules to ensure traffic to www.msftconnecttest.com and dns.msftncsi.com is permitted.
  3. Adjust the gateway configuration to ensure MAC authorisation is applied instantaneously, preventing subsequent NCSI probes from being intercepted.
Notes de mise en œuvre : Windows NCSI re-evaluates connectivity after authentication. If the gateway lags in updating its rules, the NCSI probe is intercepted again, causing Windows to assume the portal is still active. Rapid rule propagation is essential.

Analyse de scénario

Q1. You are deploying a captive portal for a large retail chain. The security team insists that all network traffic, including the initial portal redirect, must be encrypted using HTTPS. What is the technical implication of this policy?

💡 Astuce :Consider how Apple's Captive Network Assistant (CNA) handles initial probe requests.

Afficher l'approche recommandée

Enforcing HTTPS for the initial redirect will break Apple CNA detection. The CNA probe is an HTTP GET request. If the gateway intercepts this and redirects to an HTTPS URL, the CNA will not follow the redirect gracefully, resulting in a certificate error or a failure to open the portal. The initial interception must use HTTP port 80; the user can subsequently be redirected to an HTTPS page for authentication.

Q2. A stadium network engineer reports that Android devices are showing a 'Connected, no internet' warning without prompting the user to sign in. How should the walled garden be adjusted?

💡 Astuce :Think about the difference between blocking a probe and intercepting it.

Afficher l'approche recommandée

The engineer needs to ensure that connectivitycheck.gstatic.com is allowed to resolve via DNS within the walled garden, but the HTTP traffic must be intercepted and redirected. Currently, the firewall is likely dropping the traffic entirely, causing Android to assume the internet is down rather than detecting a captive portal.

Q3. A venue wishes to implement RFC 8910 (Captive Portal API) to improve the user experience. What infrastructure changes are required to support this?

💡 Astuce :RFC 8910 relies on a positive signal during the IP assignment phase.

Afficher l'approche recommandée

The venue must update its DHCP server or access points to advertise DHCP option 114. This option must provide the URL of the Captive Portal API endpoint. When compatible devices (iOS 16+, Android 11+) receive this option during the DHCP handshake, they will immediately fetch the API and prompt the user, bypassing the need for HTTP probe interception.