This issue is solely caused by the so-called great firewall(GFW) that neither you nor your device are responsible for.
After connecting to a hotspot, the device will then try to connect to a captive portal server, if the captive portal replies(just a HTTP 204 status code), then the device considers the hotspot has internet connectivity, however that specific captive portal is currently unreachable in China because of that firewall.
The exception mentioned suggests that GFW does probably not apply to that hotspot.
2 workarounds:
1:
Just ignore the warning by choose the option that you are going to use this wifi hotspot anyway.
2:
Manually change the captive portal server to something that can be directly accessed in China, using adb commands.
Provided you know some basics about Android development, you will then surely understand this does not void the warranty.
adb shell "settings put global captive_portal_https_url https://developers.google.cn/generate_204"
Note
the default captive portal server(7.1.1+) is https://connectivitycheck.gstatic.com/generate_204
related issuetracker:
developers.google.cn is hosted by Google China division which can be generally considered safer than other captive portal servers.
引用自:https://productforums.google.com/forum/#!msg/phone-by-google/K_o4E4r67dY/Qvaplc6qAQAJ