我对CertificatePinner进行了改造,以连接https://api.blablabla.com 这是下面的代码。即使certificatepinner中的引脚和模式完全错误,改造也可以成功连接到api,它不应该连接到服务器吗?我想念什么?
static OkHttpClient.Builder httpClient = new OkHttpClient.Builder()
.connectTimeout(20, TimeUnit.SECONDS);
CertificatePinner certificatePinner = new CertificatePinner.Builder()
.add(
"https://www.goodgle.com.tr", // this is wrong address
"sha256/6OcCAYrebyAu0zfHwYOfruRCL77asdadsfasdfxkP8=" // this is wrong sha256 pin
).build();
retrofit = new Retrofit.Builder()
.baseUrl(Config.API_BASE_URL) // api_base_url is correct and it is like https://apis.mapissadfasdf.com
.addConverterFactory(GsonConverterFactory.create(gson))
.client(httpClient.certificatePinner(certificatePinner).build())
.build();