471,354 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

SslStream object for IMAP

I am trying to connect & exchange data with IMAP server using SSL.
IMAP has command for logging in. Ex:
A100 LOGIN "abc" "agc"

I am using following code to do this...
m_pSocket.Connect( m_pobjIMapServerIPAddress, 993);
m_pNetworkStream = new System.Net.Sockets.NetworkStream( m_pSocket

System.Net.Security.RemoteCertificateValidationCal lback
objRemoteCertificateValidationCallback =
System.Net.Security.RemoteCertificateValidationCal lback(ValidateServerCertificate);
System.Net.Security.LocalCertificateSelectionCallb ack
objLocalCertificateSelectionCallback =
System.Net.Security.LocalCertificateSelectionCallb ack(SelectLocalCertificate);

System.Net.Security.SslStream m_objSllStream = new
System.Net.Security.SslStream(m_pNetworkStream, true,
sCmd = "A123" + " LOGIN " + "username" + " " + "Password";
m_objSllStream.Write(System.Text.Encoding.ASCII.Ge tBytes(sCmd.ToCharArray()),
0, sCmd.Length); /// I get crash here

My questions are..
I think, when the server sends security certificate to client, I should
get callback.
But none of my callbacks are getting called.
Pls let me know which objects to use & how to use.

Jan 27 '06 #1
0 1461

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jakob Nielsen | last post: by
2 posts views Thread by J Huntley Palmer | last post: by
1 post views Thread by Chris Mullins | last post: by
reply views Thread by John | last post: by
1 post views Thread by Dubravko Sever | last post: by
3 posts views Thread by =?Utf-8?B?VHJlY2l1cw==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.