diff --git a/Examples/CheckCiphers.hs b/Examples/CheckCiphers.hs
--- a/Examples/CheckCiphers.hs
+++ b/Examples/CheckCiphers.hs
@@ -4,6 +4,8 @@
 import Network.TLS.Cipher
 import Network.TLS
 
+import qualified Crypto.Random.AESCtr as RNG
+
 import qualified Data.ByteString as B
 import Data.Word
 import Data.Char
@@ -89,7 +91,7 @@
 	connect sock (SockAddrInet pn (head $ hostAddresses he))
 	handle <- socketToHandle sock ReadWriteMode
 
-	(Right rng) <- makeSRandomGen
+	rng <- RNG.makeSystem
 	let params = defaultParams { pCiphers = map fakeCipher ciphers }
 	ctx <- client params rng handle
 	sendPacket ctx $ Handshake $ clienthello ciphers
diff --git a/Examples/RetrieveCertificate.hs b/Examples/RetrieveCertificate.hs
--- a/Examples/RetrieveCertificate.hs
+++ b/Examples/RetrieveCertificate.hs
@@ -10,13 +10,15 @@
 import Control.Monad
 import Prelude hiding (catch)
 
+import qualified Crypto.Random.AESCtr as RNG
+
 import Text.Printf
 
 import System.Console.CmdArgs
 
 openConnection s p = do
 	ref <- newIORef Nothing
-	(Right rng) <- makeSRandomGen
+	rng <- RNG.makeSystem
 	let params = defaultParams
 		{ pCiphers           = ciphersuite_all
 		, onCertificatesRecv = \l -> do
diff --git a/Examples/Stunnel.hs b/Examples/Stunnel.hs
--- a/Examples/Stunnel.hs
+++ b/Examples/Stunnel.hs
@@ -19,6 +19,7 @@
 import qualified Data.Certificate.KeyRSA as KeyRSA
 import qualified Crypto.Cipher.RSA as RSA
 
+import qualified Crypto.Random.AESCtr as RNG
 import Network.TLS
 import Network.TLS.Extra
 
@@ -62,9 +63,6 @@
 				return False
 	return ()
 
-getRandomGen :: IO SRandomGen
-getRandomGen = makeSRandomGen >>= either (fail . show) (return . id)
-
 tlsserver srchandle dsthandle = do
 	hSetBuffering dsthandle NoBuffering
 
@@ -79,7 +77,7 @@
 	putStrLn "end"
 
 clientProcess certs handle dsthandle _ = do
-	rng <- getRandomGen
+	rng <- RNG.makeSystem
 
 	let serverstate = defaultParams
 		{ pAllowedVersions = [SSL3,TLS10,TLS11]
@@ -224,7 +222,7 @@
 			(StunnelSocket srcsocket) <- listenAddressDescription srcaddr
 			forever $ do
 				(s, _) <- accept srcsocket
-				rng    <- getRandomGen
+				rng    <- RNG.makeSystem
 				srch   <- socketToHandle s ReadWriteMode
 
 				(StunnelSocket dst)  <- connectAddressDescription dstaddr
diff --git a/Network/TLS/Extra/Connection.hs b/Network/TLS/Extra/Connection.hs
--- a/Network/TLS/Extra/Connection.hs
+++ b/Network/TLS/Extra/Connection.hs
@@ -9,6 +9,7 @@
 	( connectionClient
 	) where
 
+import Crypto.Random
 import Control.Applicative ((<$>))
 import Control.Exception
 import Data.Char
@@ -21,7 +22,7 @@
 
 -- | open a TCP client connection to a destination and port description (number or name)
 -- 
-connectionClient :: String -> String -> TLSParams -> SRandomGen -> IO TLSCtx
+connectionClient :: CryptoRandomGen g => String -> String -> TLSParams -> g -> IO TLSCtx
 connectionClient s p params rng = do
 	pn <- if and $ map isDigit $ p
 		then return $ fromIntegral $ (read p :: Int)
diff --git a/tls-extra.cabal b/tls-extra.cabal
--- a/tls-extra.cabal
+++ b/tls-extra.cabal
@@ -1,5 +1,5 @@
 Name:                tls-extra
-Version:             0.1.9
+Version:             0.2.0
 Description:
    a set of extra definitions, default values and helpers for tls.
 License:             BSD3
@@ -28,7 +28,7 @@
 
 Library
   Build-Depends:     base > 3 && < 5
-                   , tls >= 0.5 && < 0.6
+                   , tls >= 0.6 && < 0.7
                    , mtl
                    , network >= 2.3
                    , cryptohash >= 0.6
@@ -53,6 +53,7 @@
   if flag(executable)
     Build-Depends:   network
                    , cmdargs
+                   , cprng-aes
     Buildable:       True
   else
     Buildable:       False
@@ -63,6 +64,7 @@
   if flag(executable)
     Build-Depends:   network
                    , cmdargs
+                   , cprng-aes
     Buildable:       True
   else
     Buildable:       False
@@ -73,6 +75,7 @@
   if flag(executable)
     Build-Depends:   network
                    , cmdargs
+                   , cprng-aes
     Buildable:       True
   else
     Buildable:       False
