Skip to content

Commit 7273b2d

Browse files
author
Steve Shenouda
committed
Add documentation stating no support of url redirects
1 parent cb6723f commit 7273b2d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,23 @@ protected void onCreate(Bundle savedInstanceState) {
120120
new OkHttpClient()
121121
.setSslSocketFactory(OkHttp2Helper.getSSLSocketFactory());
122122
client.interceptors().add(OkHttp2Helper.getPinningInterceptor());
123+
client.setFollowRedirects(false);
123124

124125
// OkHttp 3.0.x, 3.1.x and 3.2.x
125126
OkHttpClient client =
126127
new OkHttpClient.Builder()
127128
.sslSocketFactory(OkHttp3Helper.getSSLSocketFactory())
128129
.addInterceptor(OkHttp3Helper.getPinningInterceptor())
130+
.followRedirects(false)
131+
.followSslRedirects(false)
129132

130133
// OkHttp 3.3.x and higher
131134
OkHttpClient client =
132135
new OkHttpClient.Builder()
133136
.sslSocketFactory(OkHttp3Helper.getSSLSocketFactory(), OkHttp3Helper.getTrustManager())
134137
.addInterceptor(OkHttp3Helper.getPinningInterceptor())
138+
.followRedirects(false)
139+
.followSslRedirects(false)
135140
.build();
136141
}
137142

@@ -162,6 +167,7 @@ On Android M and earlier devices, TrustKit provides uses its own implementation
162167
* The `<trust-anchors>` setting is only applied when used within the global `<debug-overrides>` tag. Hence, custom trust anchors for specific domains cannot be set.
163168
* Within the `<trust-anchors>` tag, only `<certificate>` tags pointing to a raw certificate file are supported (the `user` or `system` values for the `src` attribute will be ignored).
164169

170+
For consumers of TrustKit's OkHttpHelper solutions, redirects must to be disabled as Pinning will currently only work properly on the initial request and not any redirects
165171

166172
License
167173
-------

0 commit comments

Comments
 (0)