Browse files

certificateVerifyChain now writes error message to stderr for unsuppo…

…rted systems
  • Loading branch information...
1 parent 7845e60 commit e7ba558d3028baf34b08b8b2cad7404931f89ed7 @DougBurke committed Feb 22, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 Network/TLS/Extra/Certificate.hs
View
10 Network/TLS/Extra/Certificate.hs
@@ -34,6 +34,12 @@ import Network.TLS (TLSCertificateUsage(..), TLSCertificateRejectReason(..))
import Data.Time.Calendar
import Data.List (find)
+#if defined(NOCERTVERIFY)
+
+import System.IO (hPutStrLn, stderr)
+
+#endif
+
-- | combine many certificates checking function together.
-- if one check fail, the whole sequence of checking is cuted short and return the
-- reject reason.
@@ -52,8 +58,8 @@ certificateChecks checks x509s = do
- for now, print a big fat warning (better than nothing) and returns true -}
certificateVerifyChain_ :: [X509] -> IO TLSCertificateUsage
certificateVerifyChain_ _ = do
- putStrLn "****************** certificate verify chain doesn't yet work on your platform **********************"
- putStrLn "please consider contributing to the certificate package to fix this issue"
+ hPutStrLn stderr "****************** certificate verify chain doesn't yet work on your platform **********************"
+ hPutStrLn stderr "please consider contributing to the certificate package to fix this issue"
return CertificateUsageAccept
#else

0 comments on commit e7ba558

Please sign in to comment.