Unable to connect client to server using sslstream

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi All,


I am trying to connect client to server using sslstream. I have
created certificate using makecert.exe and using the same.The example i
am trying is from msdn for sslstream class in framework 2.0.In the
example , client is using the server name ,i am not getting what name
to be given. please any body can help me.

TcpClient client = new TcpClient(machineName, 443);
Console.WriteLine("Client connected.");
// Create an SSL stream that will close the client's
stream.
SslStream sslStream = new SslStream(
client.GetStream(),
false,
new
RemoteCertificateValidationCallback(ValidateServerCertificate),
null
);

// The server name must match the name on the server
certificate.
try
{
sslStream.AuthenticateAsClient(serverName);
}

.



Relevant Pages

  • Re: Problem with SslStream when using Windows Vista
    ... The code for the server & client follow. ... private int _port = 0; ... // SslStream using the client's network stream. ...
    (microsoft.public.dotnet.framework)
  • Re: regarding retrival of server certificate
    ... I think it might be better if you just try one of the samples for SslStream ... Joe Kaplan-MS MVP Directory Services Programming ... get a server certificate for validation and authentication. ...
    (microsoft.public.dotnet.security)
  • Re: Socket Server with Encryption help
    ... Dominick has samples of using SslStream and NegotiateStream on his blog. ... now I will write some encryption process. ... Client connects into Server and Server accepts the connection. ...
    (microsoft.public.dotnet.security)
  • sslstream and certificates
    ... I try creating a sslStream from a regular networkstream as folows ... certificate with the associated private key" ... Has someone else tried setting up a sslStream as server? ...
    (microsoft.public.dotnet.languages.csharp)
  • sslstream with cipher (TLS_RSA_WITH_AES_128_CBC_SHA)
    ... I want to use the SSLStream with the cipher ... How does I pass the cipher. ... the handshake from the server. ... // Indicates whether the authentication was ...
    (microsoft.public.dotnet.languages.csharp)