• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connect SSL with client Certificate using java code

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

My server is ssl enabled with client authentication. I have client certificate in pfx format. I installed certificate in browser so i am able connect from browser. I want to connect same thing using java code.
Can anybody tell me how to connect ssl enabled server using client certificate with JAVA code.

Thanks,
Bharat
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would recommend studying the programming examples of the JSSE; this code helps you establish an SSL session with a remote SSL server. The Client Authentication is merely an additional step in the session establishment process. I would recommend converting the PFX file (using keytool) to a JKS file. This will make it a little easier to work with the Java code since you can access and manipulate the JKS file directly with keytool on the command line. Otherwise, you'll have to constantly remember that the PFX is a PKCS12 file, and indicate this in your code as well as keytool commands.

Hope that helps.

Arshad Noor
StrongAuth, Inc.
 
Bharat Kasodariya
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Arshad.

I found the way to read pkcs12 certificate in java using JCE.

Thanks,
Bharat
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic