I did not have much knowledge in iOS classes. I am building an iOS app(Ionic 3) which required the SSL pinning. Most of the google example based on swift. May I know the steps or could anybody provide some links regarding iOS SSL pinning?
PS: I already have a certificate in my server. Also, I have done the SSL pinning with Network security configuration for Android. Ref https://developer.android.com/training/articles/security-config. Its working fine.
Thanks in advance.
Ionic 5.4.15 version solution.
To enable SSL pinning in ionic create a directory inside your root folder e.g. "certificates" and put all your certificates inside this folder. IMPORTANT: all certificates inside this folder must have suffix .cer!!!
After that modify angular.json in root project directory append this part to all occurencies of "assets" array.
then delete your www directory in root project and run "ionic build", it will generate new subdirectory "certificates" in your www folder
USE of certificates in Typescript:
I am using ionic-native http and cordova-advanced-http-plugin
Install:
Import in your root, xyz.module.ts file:
Append it to providers:
Import in your page/component, xyz.ts file:
Declare in constructor:
Pinning the certificates before any request made:
Now youre all set and may use https requests! Docs: https://ionicframework.com/docs/native/http