Link to home
Start Free TrialLog in
Avatar of jhughes4
jhughes4

asked on

Sample Java Code that performs an HTTP(s) Post using a Cert

Can someone provide some sample code on how to do an HTTP(s) post in Java that's using a digital certificate that also needs to provide an email address as part of that certificate?  Hope that's enough information.  Thanks
Avatar of muktajindal
muktajindal
Flag of India image

You will need to provide the certificate and password (if any) and also set two system properties as follows :

System.setProperty("javax.net.ssl.trustStore", "C:/j2sdk1.4.2_13/jre/lib/security/cacerts");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

Make sure that the provided keystore has your certificate imported into it.

I didn't understand the email thing. Can you provide more details ?
Avatar of jhughes4
jhughes4

ASKER

Thanks.  Can you point me to any compileable examples?  thanks again
ASKER CERTIFIED SOLUTION
Avatar of muktajindal
muktajindal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial