title: Haskell Network.Browser HTTPS Connection
body: <p>Is there a way to make https calls with the Network.Browser package.
  I'm not seeing it in the <a href="http://hackage.haskell.org/packages/archive/HTTP/4000.0.9/doc/html/Network-Browser.html" rel="noreferrer">documentation on Hackage</a>.<br>
  If there isn't a way to do it with browse is there another way to fetch https pages?</p>
  
  <p>My current test code is</p>
  
  <pre><code>import Network.HTTP
  import Network.URI (parseURI)
  import Network.HTTP.Proxy
  import Data.Maybe (fromJust)
  import Control.Applicative ((&lt;$&gt;))
  import Network.Browser
  
  retrieveUrl :: String -&gt; IO String
  retrieveUrl url = do
    rsp &lt;- browse $ request (Request (fromJust uri) POST [] "Body")
    return $ snd (rspBody &lt;$&gt; rsp)
    where uri = parseURI url
  </code></pre>
  
  <p>I've been running <strong>nc -l -p 8000</strong> and watching the output. 
  I see that it doesn't encrypt it when I do <strong>retrieveUrl <a href="https://localhost:8000" rel="noreferrer">https://localhost:8000</a></strong> </p>
  
  <p>Also when I try a real https site I get:</p>
  
  <pre><code>Network.Browser.request: Error raised ErrorClosed
  *** Exception: user error (Network.Browser.request: Error raised ErrorClosed)
  </code></pre>
  
  <p>Edit: Network.Curl solution (For doing a SOAP call)</p>
  
  <pre><code>import Network.Curl (curlGetString)
  import Network.Curl.Opts
  
  soapHeader s = CurlHttpHeaders ["Content-Type: text/xml", "SOAPAction: " ++ s]
  proxy        = CurlProxy "proxy.foo.org"
  envelope     = "myRequestEnvelope.xml"
  
  headers  = readFile envelope &gt;&gt;= (\x -&gt; return [ soapHeader "myAction"
                                                 , proxy
                                                 , CurlPost True
                                                 , CurlPostFields [x]]) 
  
  main = headers &gt;&gt;= curlGetString "https://service.endpoint"
  </code></pre>