Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pinning multiple domains with a single OkHttpClient #63

Merged

Conversation

SteveShenouda
Copy link

No description provided.

@SteveShenouda SteveShenouda force-pushed the support-multiple-domains branch from 4be4802 to 9479fb9 Compare February 13, 2020 19:59
README.md Outdated
@@ -116,20 +116,25 @@ protected void onCreate(Bundle savedInstanceState) {
connection.setSSLSocketFactory(TrustKit.getInstance().getSSLSocketFactory(serverHostname));

// OkHttp 2.x
RootTrustManager trustManager = new RootTrustManager();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OkHttpHelper

  • getSSLSocketFactory()
  • getPinningInterceptor()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! Done!

String host = mServerHostname.get();
DomainPinningPolicy serverConfig =
TrustKit.getInstance().getConfiguration().getPolicyForHostname(host);
if (serverConfig == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the need for the if/else here? What about TrustKit.getInstance().getTrustManager(host).checkServerTrusted(chain, authType) in all cases?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment to address the need

@SteveShenouda SteveShenouda force-pushed the support-multiple-domains branch from ad814a4 to 0955f28 Compare February 28, 2020 03:37
Steve Shenouda added 3 commits February 27, 2020 19:46
Add support for SSL pinning validation on multiple
different domains with a single OkHttp3 client
Add support for SSL pinning validation on multiple
different domains with a single OkHttp2 client
@SteveShenouda SteveShenouda force-pushed the support-multiple-domains branch from 0955f28 to 9593b87 Compare February 28, 2020 03:47
@SteveShenouda SteveShenouda force-pushed the support-multiple-domains branch from 9593b87 to 7273b2d Compare February 28, 2020 03:50
@SteveShenouda SteveShenouda requested a review from nabla-c0d3 March 2, 2020 23:29
@nabla-c0d3 nabla-c0d3 merged commit cb18874 into datatheorem:master Mar 9, 2020
@nabla-c0d3
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants