本文整理了Java中okhttp3.internal.Util.platformTrustManager()
方法的一些代码示例,展示了Util.platformTrustManager()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.platformTrustManager()
方法的具体详情如下:
包路径:okhttp3.internal.Util
类名称:Util
方法名:platformTrustManager
暂无
代码示例来源:origin: square/okhttp
/**
* Add all of the host platform's trusted root certificates. This set varies by platform
* (Android vs. Java), by platform release (Android 4.4 vs. Android 9), and with user
* customizations.
*
* <p>Most TLS clients that connect to hosts on the public Internet should call this method.
* Otherwise it is necessary to manually prepare a comprehensive set of trusted roots.
*
* <p>If the host platform is compromised or misconfigured this may contain untrustworthy root
* certificates. Applications that connect to a known set of servers may be able to mitigate
* this problem with {@linkplain CertificatePinner certificate pinning}.
*/
public Builder addPlatformTrustedCertificates() {
X509TrustManager platformTrustManager = Util.platformTrustManager();
Collections.addAll(trustedCertificates, platformTrustManager.getAcceptedIssuers());
return this;
}
代码示例来源:origin: square/okhttp
this.certificateChainCleaner = builder.certificateChainCleaner;
} else {
X509TrustManager trustManager = Util.platformTrustManager();
this.sslSocketFactory = newSslSocketFactory(trustManager);
this.certificateChainCleaner = CertificateChainCleaner.get(trustManager);
代码示例来源:origin: com.squareup.okhttp3/okhttp
this.certificateChainCleaner = builder.certificateChainCleaner;
} else {
X509TrustManager trustManager = Util.platformTrustManager();
this.sslSocketFactory = newSslSocketFactory(trustManager);
this.certificateChainCleaner = CertificateChainCleaner.get(trustManager);
代码示例来源:origin: com.squareup.okhttp3/okhttp-tls
/**
* Add all of the host platform's trusted root certificates. This set varies by platform
* (Android vs. Java), by platform release (Android 4.4 vs. Android 9), and with user
* customizations.
*
* <p>Most TLS clients that connect to hosts on the public Internet should call this method.
* Otherwise it is necessary to manually prepare a comprehensive set of trusted roots.
*
* <p>If the host platform is compromised or misconfigured this may contain untrustworthy root
* certificates. Applications that connect to a known set of servers may be able to mitigate
* this problem with {@linkplain CertificatePinner certificate pinning}.
*/
public Builder addPlatformTrustedCertificates() {
X509TrustManager platformTrustManager = Util.platformTrustManager();
Collections.addAll(trustedCertificates, platformTrustManager.getAcceptedIssuers());
return this;
}
代码示例来源:origin: apache/servicemix-bundles
this.certificateChainCleaner = builder.certificateChainCleaner;
} else {
X509TrustManager trustManager = Util.platformTrustManager();
this.sslSocketFactory = newSslSocketFactory(trustManager);
this.certificateChainCleaner = CertificateChainCleaner.get(trustManager);
内容来源于网络,如有侵权,请联系作者删除!