I am writing a little program that needs to fetch some information over the network.
connect to a host:port and get a
Socket back. Using
System.IO I can use
socketToHandle to get a “file” handle, and I then use
hGetLine on the handle. Easy.
Now I want to be able to do the same for a server using TLS. With
Network.Simple.TCP.TLS I get a
Context back instead of a
Socket. How can I get a “file” handle from that? I can’t figure that out.
Should I be going about this a completely different way?
I would like to keep the code that sends and receives the same, so I can fetch from non-TLS and TLS with the same “dialogue”.
Should I be using different libraries?
The servers I am talking to talk nntp/nntps, and the back-and-forth is really simple (send “group GROUPNAME”, receive “200 OK”, send “article NUMBER”, receive some lines of text).