Skip to content

Commit

Permalink
Test suite support for crypton-connection 0.4 (fixes #512)
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Jun 30, 2024
1 parent 0deecaa commit 5f2ad8a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions network-conduit-tls/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.4.0.1

* Fix test suite for crypton-connection 0.4 [#512](https://github.com/snoyberg/conduit/issues/512)

## 1.4.0

* Migrate to crypton
Expand Down
3 changes: 2 additions & 1 deletion network-conduit-tls/network-conduit-tls.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: network-conduit-tls
version: 1.4.0
version: 1.4.0.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
Expand Down Expand Up @@ -42,4 +42,5 @@ test-suite test
, network-conduit-tls
, bytestring
, HUnit
, data-default-class
ghc-options: -Wall -threaded
11 changes: 10 additions & 1 deletion network-conduit-tls/test/main.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
import Test.HUnit
import Data.Conduit
import Data.Conduit.Network (appSource, appSink)
Expand All @@ -7,6 +8,9 @@ import Control.Concurrent (forkIO, threadDelay, killThread)
import qualified Network.Connection as NC
import qualified Data.ByteString as BS

#if MIN_VERSION_crypton_connection(0,4,0)
import qualified Data.Default.Class
#endif

testKeyRaw :: BS.ByteString
testKeyRaw = "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAwAU371YZKOVON+S/TpNERcSbe5vWk0kdodR/cC7iwQ40ukO6\nIH7H40THVAWQwlD6kasRdsxcsk+KcOpoBgivw9izJ7ggBp7reFe8mJRp2qMGyK+n89ZRHNlVWl1qSAC/o0A1ldvyfZ2X4nNYHVAFqwhPSsFTxQgxORJbL7qdKy1tirqg\nWp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UCgYEAwp+tIaPa4ZpdWiXmUSe1d4Wm6cL6WvXjJGpx\nhzTRakg1z35IRo2ABltQpmIfIQd1SjZlnl/fsc1HeeDjhXwT2wTgt2phY4B9ZN0z\nmDpDXxPhBigntnpc0N6ceXAakKj4x0xybv2Er4zlQuPQgMSGq+/IZemQDQxYhvOP\nkAyvfX0CgYBEVKvhcXQ9ETmEsk0FxPvpS9CtWXaNWItVzC/z3+mrU2B5JPcBQF72\nBsuoupeq52S+SGH7el5Xp2AoLXjZYsQ9S0t76p6G3lE/cHmnc/QNt4kT6oe5mpv1\nYXIo3/044Cbw2FEkEaj0iucagYCoqhlZTFN8aR6dXFTmvU+k6VP7pg==\n-----END RSA PRIVATE KEY-----"
Expand All @@ -25,7 +29,12 @@ clientConfig :: TLSClientConfig
clientConfig = tlsClientConfig 4242 "127.0.0.1"

clientConfigNoCA :: TLSClientConfig
clientConfigNoCA = clientConfig {tlsClientTLSSettings = NC.TLSSettingsSimple True False False}
clientConfigNoCA = clientConfig
{ tlsClientTLSSettings = NC.TLSSettingsSimple True False False
#if MIN_VERSION_crypton_connection(0,4,0)
Data.Default.Class.def
#endif
}

testSimpleServerClient :: IO ()
testSimpleServerClient = do
Expand Down

0 comments on commit 5f2ad8a

Please sign in to comment.