3

I'm still a haskell newbie but i'm attempting a simple http-conduit example"

import Network.HTTP.Conduit -- the main module

import qualified Data.ByteString.Lazy as L

simpleRequest :: IO ()
simpleRequest = do
    request <- parseUrl var2
    print var2
    let settings = mkManagerSettings (TLSSettingsSimple True False False) Nothing
    res <- withManagerSettings settings $ httpLbs request
    print res

If var2 is:

var2 = "https://github.com"

it now works but switching to my superecret url

var3 = "https://blah_request_goes_here" it does not.

Testing var2 in the browser gives back an xml document as expected. This also used to work"

I get this error with var3:

*** Exception: Error_EOF

Sorry as this is a domain specific link i can't really share it. If i can provide any other info let me know. Trying to start simple and convert a node.js service to haskell. Any help in getting a better error or debugging would be really helpful..

Changing (TLSSettingsSimple True False False) to (TLSSettingsSimple False False False) gives an expected certificate error but that's all I knew how to do..

mightybyte
  • 7,282
  • 3
  • 23
  • 39
prussiap
  • 667
  • 1
  • 7
  • 14
  • It's quite likely to be a problem with self-signed or in-org issued CA certificates. Is the server presenting a certificate at all? It doesn't redirect to HTTP or similar? – Impredicative Jan 27 '14 at 17:06
  • hi. how would I determine that? All i know is changing `TLSSettingsSimple True False False` to `TLSSettingsSimple False False False1 I get `*** Exception: TlsException (HandshakeFailed (Error_Protocol ("certificate has unknown CA",True,UnknownCa)))` – prussiap Jan 27 '14 at 17:31
  • 2
    It's a good idea to follow the [troubleshooting advice for the `tls` package](https://github.com/vincenthz/hs-tls#certificate-issues). This will likely give much more information about what's causing the problem. – Michael Snoyman Jan 27 '14 at 18:28
  • thanks.. i hadn't come across my page whilst googling.. let me check it out.. perhaps another library to do https will help also. – prussiap Jan 27 '14 at 18:58
  • hi I ran across this in your repo [link](https://github.com/snoyberg/http-conduit/issues/136) running the tls-simpleclient with my uri does work and return info. what I did get at the end though is `debug: >> Alert [(AlertLevel_Fatal,UnknownCa)] tls-simpleclient: HandshakeFailed (Error_Protocol ("certificate has unknown CA",True,UnknownCa))` which is true since checking godaddy shows that certificate has issues.. In any case this is a small step.. any thoughts ? – prussiap Jan 28 '14 at 14:35

0 Answers0