Link to home
Start Free TrialLog in
Avatar of hhi
hhi

asked on

Using HttpUrlConnection to secure server https

I'm tring to use:
url = 'URL address with HTTPS"
url.openConnection()


The server that I'm tring to connect is using "Snake Oil" certificate.

When I invoke this method I get Authorization poblem with the certificate.

When I do the same on SUN , https site I don't have any problem.

Do you know how to solve this issue ?

Thanks,
HHI

Avatar of Mick Barry
Mick Barry
Flag of Australia image

What sort of authentication problem?
Avatar of hhi
hhi

ASKER

The following message:

 exception : <untrusted server cert chain>.
Maybe the jvm does not trust the "Snake Oil" certificate. i.E it is not validated by a trusted CA1.
You have to import the "Snake Oil" certificate in to the cacerts.

Avatar of hhi

ASKER

How do I do it ?
ASKER CERTIFIED SOLUTION
Avatar of Oliver_Dornauf
Oliver_Dornauf
Flag of Afghanistan 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
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points for Oliver_Dornauf

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venabili
EE Cleanup Volunteer