gpt4 book ai didi

java - CertPathValidatorException:找不到证书路径的信任 anchor 。更新gradle和gradle插件后在android中

转载 作者:行者123 更新时间:2023-12-03 05:02:58 28 4
gpt4 key购买 nike

我尝试通过以下代码检查SSL(并成功运行):

OkHttpClient.Builder httpBuilder = new OkHttpClient.Builder();
CertificatePinner certificatePinner = new CertificatePinner.Builder()
.add("example.com", "sha256/S4AbJNGvyS57nzJwv8sPMUML8VHSqH1vbiBftdPcErI=")
.build();
OkHttpClient client1 = httpBuilder
.certificatePinner(certificatePinner)
.build();
Retrofit retrofit1 = new Retrofit.Builder()
.client(client1)
.baseUrl("https://example.com/").addConverterFactory(GsonConverterFactory.create()).build();
samaniumRestApi2 userClient = retrofit1.create(samaniumRestApi2.class);
Call<Object> call = userClient.maintenanceMode(requestmaintenanceModeCheck);
call.enqueue(xxxxxxxxxxxxx);
我将基本网址更改为以下错误:
https://example.com:448/
要么
https://subdomain.example.com/
错误是:
CertPathValidatorException: Trust anchor for certification path not found.
请救救我

最佳答案

这意味着该证书是为www.example.com颁发的,因此对于what.example.com来说是不可信任的-该服务器需要正确的签名证书

关于java - CertPathValidatorException:找不到证书路径的信任 anchor 。更新gradle和gradle插件后在android中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64571266/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com