Tuesday, May 28, 2024
HomeiOS DevelopmentThe best way to obtain ssl pinning or ssl certificates pinning in...

The best way to obtain ssl pinning or ssl certificates pinning in ionic 3 angular 5 software for each IOS and ANDROID


I’ve discovered 2 answer for attaining the above one
1] for ANDROID

          Pining SHA-256 Public key in network_security_confile.xml file
        <?xml model="1.0" encoding="utf-8"?>
        <network-security-config>
          <domain-config cleartextTrafficPermitted="false">
          <area includeSubdomains="true">yourserver.com</area>
          <pin-set expiration="2025-01-01">
          <pin digest="SHA-256">HYrCjnv1DYq5Fjy3cgMScHZbpFMKoLQaUBQ39fxztmE=</pin>
          </pin-set>
         </domain-config>
       </network-security-config>

2]for IOS
Plugin: $ ionic cordova plugin add cordova-plugin-advanced-http
$ npm set up –save @ionic-native/http@4
after putting in and importing they’ve talked about that pin the certificates for ios like this

**step:1 **
1]Importing that http in my app.module.ts file including http in my supplier
a]import { HTTP } from ‘@ionic-native/http’

   b] suppliers: [
                 StatusBar,
                 SplashScreen,
              HTTP,
                  { provide: ErrorHandler, useClass: IonicErrorHandler }
               ]
 2]Place your .cer information within the www/certificates listing of your Ionic mission.

step:2

        constructor(non-public http: HTTP, non-public platform: Platform) {
              this.platform.prepared().then(() => {
                if (this.platform.is('cordova')) {
                   // Allow SSL pinning
                    this.http.setServerTrustMode('pinned');
                    this.http.setPinningMode('default');

              }
            });
            }

SSL PINNING for IOS
After including that code snippet I get error like after I hover on setServerTrustMode and setPinningMode. Property ‘setServerTrustMode’ doesn’t exist on sort ‘HTTP’ and Property ‘setPinningMode’ doesn’t exist on sort ‘HTTP’

at the moment it isn’t working , If there some other adequate technique is there please let me know that….



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments