0

我看到我的一些应用用户在通过 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);
}

请告知代码是否有任何问题。

4

0 回答 0