packages feed

http-client-openssl 0.2.1.1 → 0.2.2.0

raw patch · 4 files changed

+11/−13 lines, 4 filesdep ~HsOpenSSLPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: HsOpenSSL

API changes (from Hackage documentation)

- Network.HTTP.Client.OpenSSL: withOpenSSL :: IO a -> IO a
+ Network.HTTP.Client.OpenSSL: withOpenSSL :: () => IO a -> IO a

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.2.2.0++* Tell OpenSSL what host is being contacted, so it can use the SNI extension for certificate selection if the server requires it.+ ## 0.2.1.1  * Fix a connection-bug with http-proxy(Previous version closes a connection before reading all respose-data.)
Network/HTTP/Client/OpenSSL.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE ScopedTypeVariables #-} -- | Support for making connections via the OpenSSL library. module Network.HTTP.Client.OpenSSL     ( opensslManagerSettings@@ -10,16 +8,11 @@ import Network.HTTP.Client import Network.HTTP.Client.Internal import Control.Exception-import Network.Socket (HostAddress) import Network.Socket.ByteString (sendAll, recv) import OpenSSL import qualified Network.Socket as N import qualified OpenSSL.Session       as SSL --- | FIXME This needs better defaults-defaultMakeContext :: IO SSL.SSLContext-defaultMakeContext = SSL.context- -- | Note that it is the caller's responsibility to pass in an appropriate -- context. Future versions of http-client-openssl will hopefully include a -- sane, safe default.@@ -27,14 +20,14 @@ opensslManagerSettings mkContext = defaultManagerSettings     { managerTlsConnection = do         ctx <- mkContext-        return $ \_ha host port -> do+        return $ \_ha host' port' -> do             -- Copied/modified from openssl-streams             let hints      = N.defaultHints                                 { N.addrFlags      = [N.AI_ADDRCONFIG, N.AI_NUMERICSERV]                                 , N.addrFamily     = N.AF_INET                                 , N.addrSocketType = N.Stream                                 }-            (addrInfo:_) <- N.getAddrInfo (Just hints) (Just host) (Just $ show port)+            (addrInfo:_) <- N.getAddrInfo (Just hints) (Just host') (Just $ show port')              let family     = N.addrFamily addrInfo             let socketType = N.addrSocketType addrInfo@@ -45,6 +38,7 @@                 $ \sock -> do                     N.connect sock address                     ssl <- SSL.connection ctx sock+                    SSL.setTlsextHostName ssl host'                     SSL.connect ssl                     makeConnection                         (SSL.read ssl 32752)@@ -52,14 +46,14 @@                         (N.close sock)     , managerTlsProxyConnection = do         ctx <- mkContext-        return $ \connstr checkConn serverName _ha host port -> do+        return $ \connstr checkConn _serverName _ha host' port' -> do             -- Copied/modified from openssl-streams             let hints      = N.defaultHints                                 { N.addrFlags      = [N.AI_ADDRCONFIG, N.AI_NUMERICSERV]                                 , N.addrFamily     = N.AF_INET                                 , N.addrSocketType = N.Stream                                 }-            (addrInfo:_) <- N.getAddrInfo (Just hints) (Just host) (Just $ show port)+            (addrInfo:_) <- N.getAddrInfo (Just hints) (Just host') (Just $ show port')              let family     = N.addrFamily addrInfo             let socketType = N.addrSocketType addrInfo@@ -76,6 +70,7 @@                     connectionWrite conn connstr                     checkConn conn                     ssl <- SSL.connection ctx sock+                    SSL.setTlsextHostName ssl host'                     SSL.connect ssl                     makeConnection                         (SSL.read ssl 32752)
http-client-openssl.cabal view
@@ -1,5 +1,5 @@ name:                http-client-openssl-version:             0.2.1.1+version:             0.2.2.0 synopsis:            http-client backend using the OpenSSL library. description:         Hackage documentation generation is not reliable. For up to date documentation, please see: <http://www.stackage.org/package/http-client>. homepage:            https://github.com/snoyberg/http-client
test/Spec.hs view
@@ -3,7 +3,6 @@ import Test.Hspec import Network.HTTP.Client import Network.HTTP.Client.OpenSSL-import Network.HTTP.Client.Internal import Network.HTTP.Types import qualified OpenSSL.Session       as SSL