<div dir="ltr">Okay ... looks like connection is exactly what I want .... The examples work just fine on Linux .. however, on Windows, I continue to get the WSACONNECTIONREFUSED eror.<div><br></div><div style>Even adding a &quot;withSocketsDo&quot; does not seem to help.</div>
<div style><br></div><div style>Regards,</div><div style>Kashyap</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 24, 2013 at 8:58 AM, C K Kashyap <span dir="ltr">&lt;<a href="mailto:ckkashyap@gmail.com" target="_blank">ckkashyap@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank you so much Vincent,<div><br></div><div>I think this is what I need ... I tried to use it to connect to a local web server running in 443 - <a href="http://hpaste.org/82943" target="_blank">http://hpaste.org/82943</a> however, I get the following error - </div>

<div><br></div><div>ssl_client.hs: connect: failed (Connection refused (WSAECONNREFUSED))</div><div><br></div><div>Am I missing something?</div><div><br></div><div>Regards,</div><div>
Kashyap</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 24, 2013 at 3:42 AM, Vincent Hanquez <span dir="ltr">&lt;<a href="mailto:tab@snarc.org" target="_blank">tab@snarc.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 02/23/2013 06:58 PM, C K Kashyap wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The reason I want to use TLS is that I&#39;d want to pack the whole thing in a<br>
DLL and give it off to a friend for use.<br>
<br>
What I am really looking for is a small sample code that demonstrates how<br>
TLS package can be used to connect to a webserver or imapserver.<br>
<br>
Regards,<br>
Kashyap<br>
</blockquote>
<br></div>
Kashyap,<br>
<br>
I suggest you look at the connection package [1] which is made for this specific purpose, and comes with examples on how to use it [2].<br>
<br>
If you want to only use tls, i suggest to look at connection&#39;s code [3], or the tls-debug [4] package, which got many small utils that use tls.<br>
<br>
[1] <a href="http://hackage.haskell.org/package/connection" target="_blank">http://hackage.haskell.org/<u></u>package/connection</a><br>
[2] &lt;<a href="https://github.com/vincenthz/hs-connection" target="_blank">https://github.com/vincenthz/<u></u>hs-connection</a>&gt;<a href="https://github.com/vincenthz/hs-connection/tree/master/examples" target="_blank">https://github.<u></u>com/vincenthz/hs-connection/<u></u>tree/master/examples</a><br>


[3] <a href="https://github.com/vincenthz/hs-connection/blob/master/Network/Connection.hs" target="_blank">https://github.com/vincenthz/<u></u>hs-connection/blob/master/<u></u>Network/Connection.hs</a><br>
[4] <a href="https://github.com/vincenthz/hs-tls/tree/master/debug/src" target="_blank">https://github.com/vincenthz/<u></u>hs-tls/tree/master/debug/src</a><span><font color="#888888"><br>
<br>
-- <br>
Vincent<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>