views:

85

answers:

1

TLS server accepts connection from client even client cetificate is not present in servers truststore ? why ?

Server Code:

tlsContext  = SSLContext.getInstance(SSL_PROTOCOL);
tlsContext.init(getMyKeyManagers(),null,null);
SSLServerSocketFactory  fact = tlsContext.getServerSocketFactory();
tlsServerSock  = (SSLServerSocket)fact.createServerSocket();
tlsServerSock.setNeedClientAuth(true);
tlsServerSock.setWantClientAuth(true);
tlsServerSock.bind(objSocketAddress);

and start listening on Server socket code

Client Code:

SSLContext tlsContext  = SSLContext.getInstance(SSL_PROTOCOL);
tlsContext.init(getMyKeyManagers(), getMyTrustManagers(), null);
SSLSocketFactory  fact =   tlsContext.getSocketFactory();
socket = fact.createSocket();
socket.connect(objSocketAddress);

as code depicts there are no TrustManagers added at Server-side still client authentication is successful? why is so ?? please help

A: 

if there is no trustmananager, then a client cert is nog needed.

an other posebillity is that one of the issuers of the client certificate is present in the truststore at the server.

Salandur
is it like that if truststore @ server side set to NULL then any anonymous client will be able to connect and there will be no client authentication even we have set it to true.
DD