]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/SocketLike.hs
Added a configuration flag -fssl to enable SSL support. (default: off)
[Lucu.git] / Network / HTTP / Lucu / SocketLike.hs
index b9668e067d47a281516c9fc1cc0c6835a693a20a..998e4490761bfb6324f6d5bb03a47073ec5c25c4 100644 (file)
@@ -1,5 +1,6 @@
 {-# LANGUAGE
-    FlexibleContexts
+    CPP
+  , FlexibleContexts
   , FlexibleInstances
   , TypeFamilies
   , UnicodeSyntax
@@ -11,8 +12,10 @@ module Network.HTTP.Lucu.SocketLike
     where
 import qualified Network.Socket as So
 import Network.HTTP.Lucu.HandleLike
+#if defined(HAVE_SSL)
 import qualified OpenSSL.Session as SSL
 import Prelude.Unicode
+#endif
 import qualified System.IO as I
 
 class (HandleLike (Handle s)) ⇒ SocketLike s where
@@ -30,6 +33,7 @@ instance SocketLike So.Socket where
 
     socketPort = So.socketPort
 
+#if defined(HAVE_SSL)
 instance SocketLike (SSL.SSLContext, So.Socket) where
     type Handle (SSL.SSLContext, So.Socket) = SSL.SSL
 
@@ -40,3 +44,4 @@ instance SocketLike (SSL.SSLContext, So.Socket) where
              return (ssl, addr)
 
     socketPort = So.socketPort ∘ snd
+#endif