News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
Example of MutualAuthentication over a TCP socket?  
by Paul
posted on 2005/10/04

Hello,

I am attempting to create a server and client, where both the server and client provide certificates to authenticate themselves.

On each end, I am loading a .cer certificate, and associating it with its .pvk private key file. I am setting the SecurityOptions on both ends to allow manual verification, and using the default 'display chain' callback from one of the provided examples.

On the server side, I am accepting the connection asynchronously, and every time that I call EndAccept, it throws an exception with the message "If a certificate is specified, it must have a private key."

I have checked, after loading the keys on each side, and HasPrivateKey() returns true for both.

I've traced this as far as the ChangeSecurityProtocol method in SecureSocket, when running in the server side. Up until options is cloned in this method, HasPrivateKey() returns true. After that, it returns false.

What is also strange is that, if I use the same public and private keys on both the server and the client, it does work.

Has anyone got a working example of mutual authentication? (Both sides?)

Regards,
Paul

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.