@@ -462,7 +462,11 @@ plainHTTP TLSSettings{..} s bs0 = case onInsecure of
462462 }
463463 return (conn'', TCP)
464464 DenyInsecure lbs -> do
465− sendAll s "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\n"
465+ -- http://tools.ietf.org/html/rfc2817#section-4.2
466+ sendAll s "HTTP/1.1 426 Upgrade Required\
467+ \r\nUpgrade: TLS/1.0, HTTP/1.1\
468+ \r\nConnection: Upgrade\
469+ \r\nContent-Type: text/plain\r\n\r\n"
466470 mapM_ (sendAll s) $ L.toChunks lbs
467471 sClose s
468472 throwIO InsecureConnectionDenied