@@ -61,13 +61,8 @@ runTLS tset set app = do
61 (fromClient'', bs) <- fromClient' C.$$++ sink
61 (fromClient'', bs) <- fromClient' C.$$++ sink
62 I.writeIORef ifromClient fromClient''
62 I.writeIORef ifromClient fromClient''
64− if maybe False (B.all (\w -> w < 127 && w > 8) . B.take 5) firstBS
64+ if maybe False ((== 0x16) . fst) (firstBS >>= B.uncons)
66− let conn = (socketConnection s)
67− { connRecv = getNext $ fmap (fromMaybe B.empty) C.await
71 gen <- newGenIO
66 gen <- newGenIO
72 ctx <- TLS.serverWith
67 ctx <- TLS.serverWith
@@ -89,6 +84,11 @@ runTLS tset set app = do
89 , connRecv = TLS.recvData ctx
84 , connRecv = TLS.recvData ctx
91 return (conn, sa)
86 return (conn, sa)
88+ let conn = (socketConnection s)
89+ { connRecv = getNext $ fmap (fromMaybe B.empty) C.await
93-- taken from stunnel example in tls-extra
93-- taken from stunnel example in tls-extra
94ciphers :: [TLS.Cipher]
94ciphers :: [TLS.Cipher]