Unit testing SSL pinning with URLProtocol

435 views Asked by At

Aim: Unit test app's ssl pinning

Approximate implementation aimed for:

  1. subclass URLProtocol
  2. Insert custom URLProtocol into Session's configuration
  3. Use session with custom config when generating requests
  4. catch the request and generate response with local certificate
  5. expect that when the app receives the response it will detect the same certificate

Problem encountered:

There seems to be no authentication challenge method to subclass in the URLProtocol.

Question:

How to intercept auth challenge with URLProtocol?

0

There are 0 answers