0

I am trying to implement a download manager in java for rapidshare, I am using the rapidshare API.
The problem is that for example if you go to the following link it redirects to a https page, but then when I read the content it always return me null in the InputStream When I try to put a https link in the HttpURLConnection it always throws an exeption

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path     validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors

1 Answers1

1

Use Apache Commons HTTPUtils . You can make a connection to HTTPS (thereby decrypting it) if you override the DefaultTrustManager class (to do nothing), create a new TrustManager with it, then bypass the hostname verifier with ALLOW_ALL_HOSTNAME_VERIFIER. Since your opening the connection to a place that you trust, there isn't a problem bypassing these things.

djangofan
  • 28,471
  • 61
  • 196
  • 289