Re: Connecting to MS Exchange 2003 using POP3 with SSL fails



Thank you. Meanwhile the problem is solved. The reason was a very silly one:
my Exchange server had no certificates installed.
--
Goetz Heller
Dr.Heller Information Management


"Dominick Baier [DevelopMentor]" wrote:

Hi!

glad this was helpful for you.

Have you tried to enable tracing for system.net ? does this give you more
pointers. Maybe also try a different SslProtocols value.

http://www.leastprivilege.com/TracingSystemNet.aspx


---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

I order to automate some mail processing I need to access POP3 servers
over a secure channel. A couple of MSDN articles recently written by
Dominick Baier was helpful to me when I implemented a solution in C#
with the .NET Framework 2.0. It works fine as far as I don't try to
connect to an MS Exchange 2003 server: In this case, the connection is
terminated by the server. Here is the somewhat simplified code:

class CMyPOPClient
{
TcpClient _Channel = null;
NetworkStream _Stream = null;
SslStream _SSLStream = null;
.
.
.
void secureConnect(String strHost, Int32 iPort)
{
.
.
.
_Channel = new TcpClient());
_Channel.Connect(strHost, iPort);
_Stream = _Channel.GetStream();
_SSLStream = new SslStream(
_Channel.GetStream(),
false,
new
RemoteCertificateValidationCallback(validateServerCertificate),
null);
_SSLStream.AuthenticateAsClient( // <== here a
System.Net.Sockets.SocketException
// is thrown with error code
10053
strHost,
null,
SslProtocols.Tls,
false);
.
.
.
}
.
.
.
}
I should mention that the code is running on a WinXPSP2 PC which is in
the same Microsoft domain as the Win 2003 Server on which MS Exchange
is running.

Actually I don't need my code being capable to connect to MS Exchange
2003 but I don't like to see it fail. Has anybody an idea what is
expected by MS Exchange 2003?




.