Hi,
I was using PureTLS to achieve mutual authentication.
The code was modified from beepcore-java's example. The key,
certificate and trusted certificate are specified on both side.
After initiation, the startTLS operation executed successfully, and the
echo channel ran with no problem too. However, when I tried to use
session.getPeerCredential() (right after startTLS at client side)
to get the credential on the server side,
the method return null. The API said getPeerCredential "may return
null if this session has not been authenticated".
I wonder how to verify that the TLS session has been
sucessfully created and the mutual authentication is finished?
I was trying to print out the subject of the certificate on
the other side, is it right to use getPeerCredential()?
Thanks a lot...
Dong
|