Method A:
java.security.cert.X509Certificate[] cert =
(java.security.cert.X509Certificate[])request.getAttribute("javax.servlet.request.X509Certificate");
session.putValue("tmp", cert[0].getSubjectDN().toString());
the cert is empty
Method B:
SSLSocketFactory factory = (SSLSocketFactory)
SSLSocketFactory.getDefault();
SSLSocket sslsock =
(SSLSocket)factory.createSocket("localhost",443);
SSLSession session1 = sslsock.getSession();
X509Certificate cert =
(X509Certificate)session1.getPeerCertificates()[0];
session.putValue("tmp", cert.getSubjectDN().toString());
the cert is empty as well.
if i print the session1 it shows SSL_NULL..... , it looks as though no
SSL Connection or my cert is invalid could that be it ?
in both cases, i've selected my certificate, keyed in my Pin, and the
page is displayed but the tmp value is always null.
Could my configuration has gone bonkers ? Please assist.
thx.