Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Windows-MY Problems

843811Jun 25 2007 — edited Oct 22 2008
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 19 2008
Added on Jun 25 2007
9 comments
1,329 views