How can I do public key pinning in Flutter?
问题 I want to the pin the public key of my server so that any request made to the server has to have that public key (this is to prevent proxies like Charles sniffing the data). I had done something similar in Android with Volley. How can I do the same with Flutter? 回答1: Create your client with a SecurityContext with no trusted roots to force the bad certificate callback, even for a good certificate. SecurityContext(withTrustedRoots: false); In the bad certificate callback, parse the DER encoded