I'm trying to use the certificates out of the Microsoft Certificate Store to open a URLConnection that requires a client certificate.
Basically, I'm doing this-
KeyStore store = KeyStore.getInstance("Windows-MY");
store.load(null, null);
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
kmf.init(store, null);
X509TrustManager tm = new NaiveTrustManager();
sc = SSLContext.getInstance("TLS");
TrustManager []tma = {tm};
sc.init(kmf.getKeyManagers(), tma, new SecureRandom());
Anyway, when I try this, I get the following error-
0000: 14 00 00 0C 4F 51 82 E8 55 95 73 AF FC A0 AB DE ....OQ..U.s.....
main, WRITE: TLSv1 Handshake, length = 32
main, waiting for close_notify or alert: state 1
main, Exception while waiting for close java.net.SocketException: Software caused connection abort: recv failed
If I create the KeyStore out of a P12 file instead of getting it from Windows-MY, it works. This P12 file is the same as the one I import into the Microsoft Certificate Store through IE.
Should creating a KeyStore out of Windows-MY work, or does it need to be a PKCS12? Any ideas?
Message was edited by:
Toshi47