Add the following line to /etc/hosts
(remember to undo this):
127.0.0.1 www.gstatic.com
Run a simple server on port 80. Here's a command you can run from bash
:
cat <<EOF | sudo python -
import SocketServer
import SimpleHTTPServer
class CustomHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type','text/html')
self.end_headers()
self.wfile.write('Captive Portal Page')
SocketServer.ThreadingTCPServer(('localhost', 80), CustomHandler).serve_forever()
EOF
Launch Chrome and navigate to an SSL page that is normally broken (adapt CHROME_PATH
for your OS):
CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
"$CHROME_PATH" --user-data-dir="/tmp/captive-portal" "https://expired.badssl.com/"
(When you're done, restore your /etc/hosts
file.)