okhttp3.internal.Util.platformTrustManager()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(239)

本文整理了Java中okhttp3.internal.Util.platformTrustManager()方法的一些代码示例,展示了Util.platformTrustManager()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.platformTrustManager()方法的具体详情如下:
包路径:okhttp3.internal.Util
类名称:Util
方法名:platformTrustManager

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);

相关文章