adb shell settings get global captive_portal_detection_enabled
adb shell settings put global captive_portal_detection_enabled 0
To resume default settings:
adb shell settings put global captive_portal_detection_enabled 1
adb shell settings get global captive_portal_server
adb shell settings put global captive_portal_server "http.url"
adb shell settings put global captive_portal_http_url "http.url"