SSL Pinning is not a default behaviour of flutter but Dio library do reject self signed certificate that we install, when using proxy server in order to intercept API Calls. Dio library provide a call back on client.badCertificateCallback
when it find some self signed certificate in between the connection.
(dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
(client) {
client.findProxy = (uri) => "PROXY 192.168.1.10:8888;";
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
};
if you return true in client.badCertificateCallback
system will accept the self signed certificate and will call the server and you will be able intercept the call in proxy server but if you return false it will reject the certificate and API call will not proceed and you won't be able to make call to the server. By default it is false.