I am trying to download some content using the URL class with the specified link coming from the server.
My download code:
URL url = new URL(downloadUrl); InputStream stream = url.openStream(); byte[] content = new byte[stream.available()]; stream.read(content); stream.close();
But at startup, I received the following exception:
java.io.IOException: SSL handshake failure: Failure in SSL library, usually a protocol error error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:604 0xaf076228:0x00000000) at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect(Native Method) ...
I used the link:
https://contentserver.com/d/761/34/215656/5de1a41ea3bc9c81978af95ed19b03286f64d9a3
I know if I write it to the browser, it will download the file, I want to download the same file through Java.
thanks
Marcos vasconcelos
source share