{"id":107548,"date":"2022-12-06T07:00:00","date_gmt":"2022-12-06T15:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=107548"},"modified":"2022-12-06T06:54:57","modified_gmt":"2022-12-06T14:54:57","slug":"20221206-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20221206-00\/?p=107548","title":{"rendered":"Trouble connecting to Web sites and services because of certificate errors? Check if you&#8217;re being held captive"},"content":{"rendered":"<p>So you&#8217;re minding your own business, and you find that Web sites and services are all failing due to certificate errors:<\/p>\n<div style=\"border: solid 1px gray; padding: 1ex;\">\n<p>outlook.office365.com<\/p>\n<p>Information you exchange with this site cannot be viewed or changed by others. However, there is a problem with the site&#8217;s security certificate.<\/p>\n<table border=\"0\" cellspacing=\"0\">\n<tbody>\n<tr style=\"background-color: transparent;\">\n<td style=\"color: #f03a16;\" valign=\"baseline\">\u274c\ufe0e<\/td>\n<td valign=\"baseline\">The security certificate was issued by a company you have not chosen to trust. View the certificate to determine whether you want to trust the certifying authority.<\/td>\n<\/tr>\n<tr style=\"background-color: transparent;\">\n<td style=\"color: #78a797;\" valign=\"baseline\">\u2714\ufe0e<\/td>\n<td valign=\"baseline\">The security certificate date is valid.<\/td>\n<\/tr>\n<tr style=\"background-color: transparent;\">\n<td style=\"color: #f03a16;\" valign=\"baseline\">\u274c\ufe0e<\/td>\n<td valign=\"baseline\">The name on the security certificate is invalid or does not match the name of the site.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Do you want to proceed?<\/p>\n<\/div>\n<p>And then if you&#8217;re the sort of nerd who actually looks at the certificate, you get something like this:<\/p>\n<div style=\"border: solid 1px gray; padding: 1px;\">\n<p><b> This CA Root certificate is not trusted. To enable trust, install this certificate in the Trusted Root Certification Authorities store. <\/b><\/p>\n<table border=\"0\" cellspacing=\"0\">\n<tbody>\n<tr style=\"background-color: transparent;\">\n<td><b>Issued to:<\/b><\/td>\n<td>US<\/td>\n<\/tr>\n<tr style=\"background-color: transparent;\">\n<td><b>Issued by:<\/b><\/td>\n<td>US<\/td>\n<\/tr>\n<tr style=\"background-color: transparent;\">\n<td><b>Valid from<\/b><\/td>\n<td>1\/13\/2011 <b>to<\/b> 1\/8\/2031<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Who is &#8220;US&#8221;? Is the United States government trying to hack my connection? (And if so, why would they admit to it right in their certificate identification?)\u00b9<\/p>\n<p>Or is &#8220;US&#8221; the guy <a href=\"https:\/\/www.youtube.com\/watch?v=jQE66WA2s-A\"> to whom all my base are belong<\/a>?\u00b2<\/p>\n<p>While it&#8217;s true that you are undergoing a man-in-the-middle attack, there&#8217;s a good chance that this attack is not malicious. If you are using a public WiFi connection, say in a coffee shop or hotel, then check whether you are trapped in the captive portal.<\/p>\n<p>Open a Web browser and go to a plain <code>http<\/code> Web site (not <code>https<\/code>). You&#8217;ll probably see a message from the provider of the public WiFi connection asking you to agree to the terms of service or enter subscriber information.<\/p>\n<p>Once you get past that, go back to the Web site or service you were originally interested in, and it should work better now.<\/p>\n<p><b>Bonus chatter<\/b>: So what&#8217;s up with the &#8220;US&#8221;?<\/p>\n<p>My guess is that whoever generated the certificate for the captive portal went through some &#8220;Make me a certificate&#8221; wizard and left all the fields blank. The wizard defaulted to &#8220;Country = US&#8221;, and since that&#8217;s the only thing that was filled in, that&#8217;s the only information in the certificate.<\/p>\n<p><b>Related reading<\/b>: <a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20221115-00\/?p=107399\"> How does Windows decide whether your computer has limited or full Internet access<\/a>?<\/p>\n<p>Some follow-up notes on how Windows decides whether your computer has Internet access.<\/p>\n<p>The idea behind probing the Network Connectivity Status Indicator (NCSI) endpoint is that the system wants to know whether access to &#8220;random&#8221; Web sites will succeed, and it checks this by accessing the NCSI endpoint, which is a &#8220;random&#8221; Web site. If the access to the NCSI endpoint fails, then access to other &#8220;random&#8221; Web sites will probably also fail.\u00b3<\/p>\n<p>Yes, this can be hacked by setting up a weird WiFi network. But who cares? All that&#8217;ll happen is that the user on your network gets the wrong connectivity icon (either being told that they have full connectivity when they don&#8217;t, or vice versa), and they&#8217;ll try to connect to some Web site, and they&#8217;ll get an error, and now you have a support problem when they complain that your WiFi is broken.<\/p>\n<p>Yes, this can be fooled by uncommon network configurations. But that means that connections to random Web sites are probably also going to fail, seeing as there&#8217;s nothing particularly special about the NCSI endpoint. A user who opens a Web browser is probably not going to be able to browse the Internet.<\/p>\n<p>An important detail is that the NCSI endpoint uses <code>http<\/code>, not <code>https<\/code>. If the endpoint had been <code>https<\/code>, then the captive portal&#8217;s interruption would break the secure connection (which is what we experienced above), whereas on <code>http<\/code>, the captive portal can inject a redirect to their sign-in page.<\/p>\n<p>You can configure the NCSI probes via Group Policy. You can read more on <a title=\"An Internet Explorer or Edge window opens when your computer connects to a corporate network or a public network\" href=\"https:\/\/learn.microsoft.com\/en-us\/troubleshoot\/windows-client\/networking\/internet-explorer-edge-open-connect-corporate-public-network\"> the page I linked to in the original post<\/a>.<\/p>\n<p>This technique for detecting basic Internet access is common across all major operating systems. Windows isn&#8217;t doing anything particular sneaky here.<\/p>\n<p>\u00b9 That&#8217;s one of the things I don&#8217;t get about the conspiracy theorists who look for clues like this. If you assume that there&#8217;s some deep, highly-organized, hyper-competent conspiracy afoot, why also assume that this highly-organized conspiracy is not just inept at keeping secrets, but is openly bragging out in public? The first rule of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Fight_Club\"> Fight Club<\/a> is &#8220;you do not talk about Fight Club.&#8221; The second rule of Fight Club is &#8220;YOU DO NOT TALK ABOUT FIGHT CLUB.&#8221;<\/p>\n<p>\u00b2 Yes, I use ridiculously old memes. I&#8217;m slow to pick up on these things.<\/p>\n<p>\u00b3 In Windows 10, the name of the endpoint changed from <code>msftncsi<\/code> to <code>msftconnecttest<\/code>, presumably to make the purpose of the access more obvious in security and audit logs. Nobody will understand that NCSI stands for Network Connectivity Status Indicator. (They&#8217;ll probably confuse it with the <a href=\"Naval Criminal Investigative Service\"> Naval Crime Investigative Service<\/a>.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s a man in the middle.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[104],"class_list":["post-107548","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>There&#8217;s a man in the middle.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/107548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=107548"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/107548\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=107548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=107548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=107548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}