Permalink
Browse files

certificateVerifyDomain

  • Loading branch information...
1 parent 185dfd5 commit 47eed3f00ab5143cc2762ae24a1bcd4931f2b513 @snoyberg snoyberg committed Apr 3, 2011
Showing with 7 additions and 4 deletions.
  1. +5 −2 Network/HTTP/Enumerator.hs
  2. +1 −1 http-enumerator.cabal
  3. +1 −1 test.hs
@@ -109,7 +109,7 @@ import qualified Data.Map as Map
import qualified Data.IORef as I
import Control.Applicative ((<$>))
import Data.Certificate.X509 (X509)
-import Network.TLS.Extra (certificateVerifyChain)
+import Network.TLS.Extra (certificateVerifyChain, certificateVerifyDomain)
getSocket :: String -> Int -> IO NS.Socket
getSocket host' port' = do
@@ -362,7 +362,10 @@ parseUrl2 full sec s = do
{ host = S8.pack hostname
, port = port'
, secure = sec
- , checkCerts = certificateVerifyChain
+ , checkCerts = \x ->
+ if certificateVerifyDomain hostname x
+ then certificateVerifyChain x
+ else return False
, requestHeaders = []
, path = S8.pack
$ if null path'
View
@@ -32,7 +32,7 @@ library
, http-types >= 0.6 && < 0.7
, blaze-builder-enumerator >= 0.2 && < 0.3
, tls >= 0.5.1 && < 0.6
- , tls-extra >= 0.1.5 && < 0.2
+ , tls-extra >= 0.1.6 && < 0.2
, monad-control >= 0.2 && < 0.3
, containers >= 0.2 && < 0.5
, certificate >= 0.7 && < 0.8
View
@@ -11,7 +11,7 @@ import Data.CaseInsensitive (original)
main :: IO ()
main = withSocketsDo $ do
[url] <- getArgs
- _req2 <- parseUrl $ S8.pack url
+ _req2 <- parseUrl url
{-
let req = urlEncodedBody
[ ("foo", "bar")

0 comments on commit 47eed3f

Please sign in to comment.