@@ -462,7 +462,11 @@ plainHTTP TLSSettings{..} s bs0 = case onInsecure of
463 return (conn'', TCP)
463 return (conn'', TCP)
464 DenyInsecure lbs -> do
464 DenyInsecure lbs -> do
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\
465− sendAll s "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\n"
469+ \r\nContent-Type: text/plain\r\n\r\n"
466 mapM_ (sendAll s) $ L.toChunks lbs
470 mapM_ (sendAll s) $ L.toChunks lbs
468 throwIO InsecureConnectionDenied
472 throwIO InsecureConnectionDenied