Re: SSLStream
- From: "Dubravko Sever" <Dubravko.SeverNOSPAM@xxxxxx>
- Date: Fri, 4 May 2007 14:51:34 +0200
"Dubravko Sever" <Dubravko.SeverNOSPAM@xxxxxx> wrote in message
news:f1f3v0$ju5$1@xxxxxxxxxxxxxxxxxx
Hi,Solved,
I have problem with SSLStream. I'm using it with p12 certificate and it
works well when I running my code as console application (manully
called).
But problem starts when I tryint run it as windows service (localsystem)
and a got exception: "The server mode SSL must use a certificate with the
associated private key".
If anyone has ideas, please ..
Here is my code :
private void ProcessClient(TcpClient m_clinet) {
SslStream stream = new SslStream(m_clinet.GetStream(), false);
try
{
stream.AuthenticateAsServer(new
X509Certificate("hostcert.p12",""),false,System.Security.Authentication.SslProtocols.Tls
,true );
try {
UnicodeEncoding encoder = new UnicodeEncoding();
// GPGEncrypt encrype = new GPGEncrypt(log);
byte[] buffer = encoder.GetBytes("Some text");
stream.Write(buffer);
stream.Close();
m_clinet.Close();
}
catch (Exception eror){log.WriteLineLog(eror.Message); }
}
catch (AuthenticationException exc) { log.WriteLineLog(exc.Message); }
}
Thanks,
Problem was with windows service account.
.
- References:
- SSLStream
- From: Dubravko Sever
- SSLStream
- Prev by Date: Re: Reading date value from Excel
- Next by Date: RE: Windows Services and SQL Server
- Previous by thread: SSLStream
- Next by thread: save bit as 0 or 1not true or false
- Index(es):
Relevant Pages
|