com.dropbox.core.NetworkIOException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: не удалось проверить сертификат
Я вижу, что некоторые пользователи моего приложения сталкиваются со следующим исключением при загрузке файла через Dropbox:
Caused by javax.net.ssl.SSLHandshakeException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: Certificate expired at Thu Jul 13 02:08:08 GMT+04:00 2017 (compared to Thu Sep 07 09:00:07 GMT+04:00 2017)
Caused by java.security.cert.CertificateException: com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: Certificate expired at Thu Jul 13 02:08:08 GMT+04:00 2017 (compared to Thu Sep 07 09:00:07 GMT+04:00 2017)
Caused by com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: Certificate expired at Thu Jul 13 02:08:08 GMT+04:00 2017 (compared to Thu Sep 07 09:00:07 GMT+04:00 2017)
Caused by java.security.cert.CertificateExpiredException: Certificate expired at Thu Jul 13 02:08:08 GMT+04:00 2017 (compared to Thu Sep 07 09:00:07 GMT+04:00 2017)
Вот код для загрузки файла:
private void downloadFile(@NonNull final String inPath, @NonNull final OutputStream outputStream) throws IOException, DbxException {
mClient.files().downloadBuilder(inPath).download(outputStream);
}
public DropBox(@NonNull final String ACCESS_TOKEN) {
final OkHttpClient okHttpClient = OkHttp3Requestor.defaultOkHttpClientBuilder()
.connectTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.build();
final DbxRequestConfig config =
DbxRequestConfig
.newBuilder("")
.withHttpRequestor(new OkHttp3Requestor(okHttpClient))
.build();
mClient = new DbxClientV2(config, ACCESS_TOKEN);
}
Пожалуйста, сообщите, если что-то не так с кодом.