Browse Source

started using the latest version of the tls package

master
Jon Kristensen 15 years ago
parent
commit
9107b5a411
  1. 18
      Network/XMPP/TLS.hs
  2. 6
      pontarius-xmpp.cabal

18
Network/XMPP/TLS.hs

@ -17,7 +17,9 @@ getTLSParams, @@ -17,7 +17,9 @@ getTLSParams,
handshake'
) where
import Crypto.Random (newGenIO, SystemRandom)
import Network.TLS
import Network.TLS.Extra (cipher_AES128_SHA1)
import Network.TLS.Cipher
import GHC.IO.Handle (Handle, hPutStr, hFlush, hSetBuffering, hWaitForInput)
@ -25,23 +27,19 @@ import GHC.IO.Handle (Handle, hPutStr, hFlush, hSetBuffering, hWaitForInput) @@ -25,23 +27,19 @@ import GHC.IO.Handle (Handle, hPutStr, hFlush, hSetBuffering, hWaitForInput)
getTLSParams :: TLSParams
getTLSParams = TLSParams { pConnectVersion = TLS10
, pAllowedVersions = [TLS10,TLS11]
, pCiphers = [cipher_AES256_SHA1] -- Check the rest
, pCiphers = [cipher_AES128_SHA1] -- Check the rest
, pCompressions = [nullCompression]
, pWantClientCert = False
, pUseSecureRenegotiation = False -- TODO: No renegotiation
, pCertificates = []
, onCertificatesRecv = \_ -> return True } -- Verify cert chain
, pLogging = defaultLogging
, onCertificatesRecv = \_ -> return CertificateUsageAccept } -- Verify cert chain
handshake' :: Handle -> String -> IO (Maybe TLSCtx)
handshake' h s = do
let t = getTLSParams
r <- makeSRandomGen
case r of
Right sr -> do
putStrLn $ show sr
c <- client t sr h
r <- newGenIO :: IO SystemRandom -- Investigate limitations
c <- client t r h
handshake c
putStrLn ">>>>TLS data sended<<<<"
return (Just c)
Left ge -> do
putStrLn $ show ge
return Nothing

6
pontarius-xmpp.cabal

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
Name: pontarius-xmpp
Version: 0.0.6.0
Version: 0.0.7.0
Cabal-Version: >= 1.6
Build-Type: Simple
License: LGPL-3
@ -33,7 +33,7 @@ Library @@ -33,7 +33,7 @@ Library
Build-Depends: base >= 2 && < 5, parsec, enumerator, crypto-api,
base64-string, pureMD5, utf8-string, network, xml-types,
text, transformers, bytestring, binary, random,
xml-enumerator, tls ==0.4.1, containers, mtl, text-icu,
xml-enumerator, tls, tls-extra, containers, mtl, text-icu,
stringprep, idna2008 ==0.0.1.0
-- Other-Modules:
-- HS-Source-Dirs:
@ -65,5 +65,5 @@ Source-Repository this @@ -65,5 +65,5 @@ Source-Repository this
Type: darcs
-- Module:
Location: https://patch-tag.com/r/jonkri/pontarius-xmpp
Tag: 0.0.6.0
Tag: 0.0.7.0
-- Subdir:

Loading…
Cancel
Save