PRDownloader
PRDownloader copied to clipboard
javax.net.ssl.SSLProtocolException
javax.net.ssl.SSLProtocolException: Read error: ssl=0xb8755f90: Failure in SSL library, usually a protocol error
在模拟器上使用该下载框架总是会出现这个异常,该异常在类 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;
}
}
I need more info here.
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/