@@ -248,7 +248,7 @@ runTLSSocket' tlsset@TLSSettings{..} set credential sock app =
248 runSettingsConnectionMakerSecure set get app
248 runSettingsConnectionMakerSecure set get app
250 get = getter tlsset sock params
250 get = getter tlsset sock params
251− params = TLS.ServerParams {
251+ params = def { -- TLS.ServerParams
252 TLS.serverWantClientCert = tlsWantClientCert
252 TLS.serverWantClientCert = tlsWantClientCert
253 , TLS.serverCACertificates = []
253 , TLS.serverCACertificates = []
254 , TLS.serverDHEParams = Nothing
254 , TLS.serverDHEParams = Nothing
@@ -264,7 +264,7 @@ runTLSSocket' tlsset@TLSSettings{..} set credential sock app =
264 shared = def {
264 shared = def {
265 TLS.sharedCredentials = TLS.Credentials [credential]
265 TLS.sharedCredentials = TLS.Credentials [credential]
267− supported = TLS.Supported {
267+ supported = def { -- TLS.Supported
268 TLS.supportedVersions = tlsAllowedVersions
268 TLS.supportedVersions = tlsAllowedVersions
269 , TLS.supportedCiphers = tlsCiphers
269 , TLS.supportedCiphers = tlsCiphers
270 , TLS.supportedCompressions = [TLS.nullCompression]
270 , TLS.supportedCompressions = [TLS.nullCompression]
@@ -440,7 +440,12 @@ plainHTTP TLSSettings{..} s bs0 = case onInsecure of
441 return (conn'', TCP)
441 return (conn'', TCP)
442 DenyInsecure lbs -> do
442 DenyInsecure lbs -> do
443+ -- FIXME: what about HTTP/2?
444+ -- http://tools.ietf.org/html/rfc2817#section-4.2
445+ sendAll s "HTTP/1.1 426 Upgrade Required\
446+ \r\nUpgrade: TLS/1.0, HTTP/1.1\
447+ \r\nConnection: Upgrade\
443− sendAll s "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\n"
448+ \r\nContent-Type: text/plain\r\n\r\n"
444 mapM_ (sendAll s) $ L.toChunks lbs
449 mapM_ (sendAll s) $ L.toChunks lbs
446 throwIO InsecureConnectionDenied
451 throwIO InsecureConnectionDenied