How to use SSL Pinning with cordova-plugin-advanced-http

Would anyone have an example of how to enable the SSL Pinning with this plugin function? How do I put a certificate and set they? There are no examples of this function in the documentation.

Check out GitHub - silkimen/cordova-plugin-advanced-http: Cordova / Phonegap plugin for communicating with HTTP servers. Allows for SSL pinning!

enableSSLPinning

Enable or disable SSL pinning. This defaults to false.

To use SSL pinning you must include at least one .cer SSL certificate in your app project. You can pin to your server certificate or to one of the issuing CA certificates. For ios include your certificate in the root level of your bundle (just add the .cer file to your project/target at the root level). For android include your certificate in your project’s platforms/android/assets folder. In both cases all .cer files found will be loaded automatically. If you only have a .pem certificate see this stackoverflow answer. You want to convert it to a DER encoded certificate with a .cer extension.

As an alternative, you can store your .cer files in the www/certificates folder.

cordova.plugin.http.enableSSLPinning(true, function() {
  console.log('success!');
}, function() {
  console.log('error :(');
});

I put this on the app.componet.ts or in each page that i want to use?

Did you get the solution? Currently, I am using HTTPClient. PLease help me out, i want to implement this part

Did you manage to do it? Anyway I suspect you won’t be able to use HTTPClient by Angular anymore. You have to use https://github.com/silkimen/cordova-plugin-advanced-http

Beginner level developers have no idea about How to generate .cer file for SSL Pinning
I found this helpful for people like me.

SSL Pinning example :sunglasses:

This is a simplest example

Can u please tell me where the root level of project/target is for iOS ??