![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hello, Tom! What version of SSL/TLS does that cisco router use? And what version did you specify in your code? -- With best regards, Vadym Stetsiak. Blog: http://vadmyst.blogspot.com You wrote on Tue, 25 Sep 2007 19:10:03 -0700: T> Greeting all, T> I have a question of secure communication between a vb.net 2005 app T> and cisco routers. I appoligize if I don't provide enough info but T> here goes. T> I have written an application that successfully communicates with T> routers using unsecure sockets (system.net.sockets). I need to T> change that to use secure communication. T> I have been trying to get SslStream (system.net.security) to work. I T> have read all the documentation but nothing is working. I am T> creating a TCPClient then using that client in the SslStream T> creation. I'm not getting an error on the SslStream creation but T> I'm not convinced that it's working. I do get the error when I try T> to AuthenticateAsClient. The error I get is "Handshake failed due T> to unexpected packet format." T> here is the code T> public function ValidateServerCertificate(object T> sender,X509Certificate certificate, X509Chain chain,SslPolicyErrors T> sslPolicyErrors) as boolean T> if (sslPolicyErrors = SslPolicyErrors.None) T> return true end if T> Console.WriteLine("Certificate error: {0}", T> sslPolicyErrors); T> 'Do not allow this client to communicate with T> unauthenticated servers. T> return false end function T> sub... T> ... T> client TcpClient = new TcpClient(IPAddressofRouter,443) T> sslStream SslStream = new SslStream(client.GetStream(), false, T> new RemoteCertificateValidationCallback (AddressOf T> ValidateServerCertificate), null) T> sslStream.AuthenticateAsClient(serverName) T> ... T> I noticed when I step through my code, ValidateServerCertificate T> never gets called. I'm not exactly sure how that part works. T> Any ideas what may be wrong? T> Is this actually the best approach? T> Any help is GREATLY appreciated. T> Thanks T> Tom |
#4
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |