[英]CertPathValidatorException: Trust anchor for certification path not found. in android after update gradle and gradle plugin
I try to check SSL, by this code (and work successfully):我尝试通过此代码检查 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);
and I get error by change base url to:我通过将基本 url 更改为:
https://example.com:448/
or或者
https://subdomain.example.com/
and error is :错误是:
CertPathValidatorException: Trust anchor for certification path not found.
please save me请救救我
这意味着证书是为www.example.com颁发的,因此对于whatever.example.com 来说是不可信的——这个服务器需要正确的签名证书
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.