Aim: Unit test app's ssl pinning
Approximate implementation aimed for:
- subclass URLProtocol
- Insert custom URLProtocol into Session's configuration
- Use session with custom config when generating requests
- catch the request and generate response with local certificate
- 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?