File tree Expand file tree Collapse file tree
trustkit/src/main/java/com/datatheorem/android/trustkit/pinning Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616@ RequiresApi (api = 17 )
1717public class OkHttp2Helper {
18- private static RootTrustManager trustManager = new RootTrustManager ();
18+ private static OkHttpRootTrustManager trustManager = new OkHttpRootTrustManager ();
1919
2020 /**
2121 * Retrieve an {@code SSLSSocketFactory} that implements SSL pinning validation based on the
@@ -42,11 +42,11 @@ public static SSLSocketFactory getSSLSocketFactory() {
4242
4343 /**
4444 * Returns an {@link com.squareup.okhttp.Interceptor} used to parse the hostname of the
45- * {@link Request} URL and then save the hostname in the {@link RootTrustManager } which will
45+ * {@link Request} URL and then save the hostname in the {@link OkHttpRootTrustManager } which will
4646 * later be used for Certificate Pinning.
4747 */
4848 @ NonNull
4949 public static Interceptor getPinningInterceptor () {
50- return new PinningInterceptor2 (trustManager );
50+ return new OkHttp2PinningInterceptor (trustManager );
5151 }
5252}
Original file line number Diff line number Diff line change 1010
1111/**
1212 * {@link Interceptor} used to parse the hostname of the {@link Request} URL and then save the
13- * hostname in the {@link RootTrustManager } which will later be used for Certificate Pinning.
13+ * hostname in the {@link OkHttpRootTrustManager } which will later be used for Certificate Pinning.
1414 */
15- public class PinningInterceptor2 implements Interceptor {
16- private final RootTrustManager mTrustManager ;
15+ public class OkHttp2PinningInterceptor implements Interceptor {
16+ private final OkHttpRootTrustManager mTrustManager ;
1717
18- public PinningInterceptor2 (@ NonNull RootTrustManager trustManager ) {
18+ public OkHttp2PinningInterceptor (@ NonNull OkHttpRootTrustManager trustManager ) {
1919 mTrustManager = trustManager ;
2020 }
2121
Original file line number Diff line number Diff line change 1515
1616@ RequiresApi (api = 17 )
1717public class OkHttp3Helper {
18- private static RootTrustManager trustManager = new RootTrustManager ();
18+ private static OkHttpRootTrustManager trustManager = new OkHttpRootTrustManager ();
1919
2020 /**
2121 * Retrieve an {@code SSLSSocketFactory} that implements SSL pinning validation based on the
@@ -42,19 +42,19 @@ public static SSLSocketFactory getSSLSocketFactory() {
4242
4343 /**
4444 * Returns an {@link okhttp3.Interceptor} used to parse the hostname of the {@link Request} URL
45- * and then save the hostname in the {@link RootTrustManager } which will later be used for
45+ * and then save the hostname in the {@link OkHttpRootTrustManager } which will later be used for
4646 * Certificate Pinning.
4747 */
4848 @ NonNull
4949 public static Interceptor getPinningInterceptor () {
50- return new PinningInterceptor (trustManager );
50+ return new OkHttp3PinningInterceptor (trustManager );
5151 }
5252
5353 /**
54- * Returns an instance of the {@link RootTrustManager } used for Certificate Pinning.
54+ * Returns an instance of the {@link OkHttpRootTrustManager } used for Certificate Pinning.
5555 */
5656 @ NonNull
57- public static RootTrustManager getTrustManager () {
57+ public static OkHttpRootTrustManager getTrustManager () {
5858 return trustManager ;
5959 }
6060}
Original file line number Diff line number Diff line change 1010
1111/**
1212 * {@link Interceptor} used to parse the hostname of the {@link Request} URL and then save the
13- * hostname in the {@link RootTrustManager } which will later be used for Certificate Pinning.
13+ * hostname in the {@link OkHttpRootTrustManager } which will later be used for Certificate Pinning.
1414 */
15- public class PinningInterceptor implements Interceptor {
16- private final RootTrustManager mTrustManager ;
15+ public class OkHttp3PinningInterceptor implements Interceptor {
16+ private final OkHttpRootTrustManager mTrustManager ;
1717
18- public PinningInterceptor (@ NonNull RootTrustManager trustManager ) {
18+ public OkHttp3PinningInterceptor (@ NonNull OkHttpRootTrustManager trustManager ) {
1919 mTrustManager = trustManager ;
2020 }
2121
Original file line number Diff line number Diff line change 1717 * {@link X509TrustManager} used for Certificate Pinning.
1818 *
1919 * <p>This trust manager delegates to the appropriate {@link PinningTrustManager} decided by the
20- * hostname set by the {@link PinningInterceptor }.</p>
20+ * hostname set by the {@link OkHttp3PinningInterceptor }.</p>
2121 */
2222@ RequiresApi (api = 17 )
23- class RootTrustManager implements X509TrustManager {
23+ class OkHttpRootTrustManager implements X509TrustManager {
2424 private final ThreadLocal <String > mServerHostname = new ThreadLocal <>();
2525
2626 @ Override
You can’t perform that action at this time.
0 commit comments