network-conduit-tls 1.0.4 → 1.0.4.1
raw patch · 2 files changed
+6/−22 lines, 2 filesdep −directorydep ~tls
Dependencies removed: directory
Dependency ranges changed: tls
Files
- Data/Conduit/Network/TLS.hs +4/−19
- network-conduit-tls.cabal +2/−3
Data/Conduit/Network/TLS.hs view
@@ -63,8 +63,6 @@ import qualified Network.Connection as NC import Control.Monad.Trans.Control import Data.Default-import System.IO (hClose, openBinaryTempFile)-import System.Directory (removeFile, getTemporaryDirectory) makeCertDataPath :: FilePath -> FilePath -> TlsCertData@@ -213,23 +211,10 @@ readCreds :: TlsCertData -> IO TLS.Credentials readCreds (TlsCertData iocert iokey) =- -- FIXME This whole function is an ugly hack. Need to figure out the right- -- way to do this in tls 1.2.- go iocert $ \certfp -> go iokey $ \keyfp -> do- ecreds <- TLS.credentialLoadX509 certfp keyfp- case ecreds of- Left err -> error $ "Error reading TLS credentials: " ++ err- Right creds -> return $ TLS.Credentials [creds]- where- go iobs f = do- tempdir <- getTemporaryDirectory- bracket- (openBinaryTempFile tempdir "network-conduit-tls.bin")- (\(fp, h) -> hClose h >> removeFile fp)- $ \(fp, h) -> do- iobs >>= S.hPutStr h- hClose h- f fp+ (TLS.credentialLoadX509FromMemory <$> iocert <*> iokey)+ >>= either+ (error . ("Error reading TLS credentials: " ++))+ (return . TLS.Credentials . return) readCertificates :: TlsCertData -> IO [X509.X509] readCertificates certData = do
network-conduit-tls.cabal view
@@ -1,5 +1,5 @@ name: network-conduit-tls-version: 1.0.4+version: 1.0.4.1 synopsis: Create TLS-aware network code with conduits description: Uses the tls package for a pure-Haskell implementation. homepage: https://github.com/snoyberg/conduit@@ -21,7 +21,7 @@ , bytestring >= 0.9 , certificate >= 1.2 , pem >= 0.1- , tls >= 1.2+ , tls >= 1.2.2 , network-conduit >= 1.0 , conduit >= 1.0 , network@@ -32,7 +32,6 @@ , connection , monad-control , data-default- , directory test-suite test hs-source-dirs: test