connection 0.2.0 → 0.2.1
raw patch · 3 files changed
+15/−6 lines, 3 files
Files
- CHANGELOG.md +7/−0
- Network/Connection.hs +5/−4
- connection.cabal +3/−2
+ CHANGELOG.md view
@@ -0,0 +1,7 @@+## Version 0.2.1 (16 April 2014)++- Fix a difference between TLSSettings and TLSSettingsSimple,+ where connection would override the connection hostname and port in+ the simple case, but leave the field as is with TLSSettings.+ TLSSettings can now be used properly as template, and will be+ correctly overriden at the identification level only.
Network/Connection.hs view
@@ -90,6 +90,8 @@ initConnectionContext :: IO ConnectionContext initConnectionContext = ConnectionContext <$> getSystemCertificateStore +-- | Create a final TLS 'ClientParams' according to the destination and the+-- TLSSettings. makeTLSParams :: ConnectionContext -> ConnectionID -> TLSSettings -> TLS.ClientParams makeTLSParams cg cid ts@(TLSSettingsSimple {}) = (TLS.defaultParamsClient (fst cid) portString)@@ -106,10 +108,9 @@ (\_ _ _ -> return ()) | otherwise = def portString = BC.pack $ show $ snd cid-makeTLSParams _ cid (TLSSettings p)- | fst cid /= fst (TLS.clientServerIdentification p) =- error "mismatch between given server identification and connection hostname"- | otherwise = p+makeTLSParams _ cid (TLSSettings p) =+ p { TLS.clientServerIdentification = (fst cid, portString) }+ where portString = BC.pack $ show $ snd cid withBackend :: (ConnectionBackend -> IO a) -> Connection -> IO a withBackend f conn = readMVar (connectionBackend conn) >>= f
connection.cabal view
@@ -1,5 +1,5 @@ Name: connection-Version: 0.2.0+Version: 0.2.1 Description: Simple network library for all your connection need. .@@ -18,7 +18,8 @@ stability: experimental Cabal-Version: >=1.6 Homepage: http://github.com/vincenthz/hs-connection-data-files: README.md+extra-source-files: README.md+ CHANGELOG.md Library Build-Depends: base >= 3 && < 5