Skip to content

Instantly share code, notes, and snippets.

@barryor
Created February 3, 2018 16:33
Show Gist options
  • Save barryor/71f065bbe182389d755e7478af461745 to your computer and use it in GitHub Desktop.
Save barryor/71f065bbe182389d755e7478af461745 to your computer and use it in GitHub Desktop.
Pinning with OkHttp3
CertificatePinner certificatePinner = new CertificatePinner.Builder()
.add("publicobject.com", "sha256/afwiKY3RxoMmLkuRW1l7QsPZTJPwDS2pdDROQjXw8ig=")
.add("bikewise.org", "sha256/x9SZw6TwIqfmvrLZ/kz1o0Ossjmn728BnBKpUFqGNVM=")
.build();
OkHttpClient client = OkHttpClient.Builder()
.certificatePinner(certificatePinner)
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment