Home All Groups Group Topic Archive Search About

Unable to connect client to server using sslstream

Author
31 Aug 2006 6:14 AM
vlaxmi2001in
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);
            }

AddThis Social Bookmark Button