PRDownloader icon indicating copy to clipboard operation
PRDownloader copied to clipboard

javax.net.ssl.SSLProtocolException

Open realicing opened this issue 7 years ago • 3 comments

javax.net.ssl.SSLProtocolException: Read error: ssl=0xb8755f90: Failure in SSL library, usually a protocol error

realicing avatar Apr 12 '18 07:04 realicing

在模拟器上使用该下载框架总是会出现这个异常,该异常在类 com.downloader.internal.DownloadTask中的195行出现,代码如下: } catch (IllegalAccessException | IOException var13) { if (!this.isResumeSupported) { this.deleteTempFile(); }

            Error error = new Error();
            error.setConnectionError(true);
            response.setError(error);
            return response;
        } finally {
            this.closeAllSafely(outputStream, fileDescriptor);
        }

        return var7;
    }
}

realicing avatar Apr 12 '18 07:04 realicing

I need more info here.

amitshekhariitbhu avatar Apr 12 '18 15:04 amitshekhariitbhu

PRDownloader uses com.prdownloader.httpclient.DefaultHttpClient you can implement your own You must add this checking in your custom HttpClient.

 if(connection instanceof HttpsURLConnection) {
    try {
        ((HttpsURLConnection) connection).setSSLSocketFactory(new TLSSocketFactory());
    } catch (KeyManagementException | NoSuchAlgorithmException e) {
        e.printStackTrace();
    }
}

TLSSocketFactory -> https://blog.dev-area.net/2015/08/13/android-4-1-enable-tls-1-1-and-tls-1-2/

yuristepanyan avatar Mar 23 '21 12:03 yuristepanyan