# Ionic 2 ssl pinning

**URL:** <https://forum.ionicframework.com/t/ionic-2-ssl-pinning/158104>\
**Category:** Ionic Framework\
**Created:** [March 4, 2019, 6:19am UTC](https://forum.ionicframework.com/t/ionic-2-ssl-pinning/158104 "2019-03-04T06:19:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aruna0901](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@aruna0901](https://forum.ionicframework.com/u/aruna0901)\
**Post date:** [March 4, 2019, 6:19am UTC](https://forum.ionicframework.com/t/ionic-2-ssl-pinning/158104/1 "2019-03-04T06:19:42Z")

</div>

Hi All,

I’m struggling with ssl pinning in our ionic 2 application. I tried with sslchecker which works fine in android with SHA 256 fingerprints. but the same is not working in iOS. So we installed the previous version of this plugin and used SHA1 fingerprints, which is working fine in both android and iOS.  
But we would like to use only SHA256 fingerprints as SHA1 is absolete.

I also tried using cordova-plugin-advanced-http plugin and placed .cer file in www/sertificates folder. But this always returns the success callback even when i use a wrong certificate or no certificate.  
Here is my code:

import { HTTP } from ‘@ionic-native/http’;  
constructor(public ihttp:HTTP) {  
}

postRequest()  
{  
this.ihttp.setSSLCertMode(‘pinned’).then(success=\>{  
console.log(“ssl connection secured”,success);  
this.post(params);

```
                    },(err)=>{
                        
                        console.log("ssl connection not secured",err)

                    });    

```

}

Any help would be highly appreciated.

Thanks,  
Aruna.

---

<div class="post-metadata">

**Author:** ![razmans](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/razmans/32/115790_2.png) [@razmans](https://forum.ionicframework.com/u/razmans)\
**Post date:** [August 8, 2021, 6:04pm UTC](https://forum.ionicframework.com/t/ionic-2-ssl-pinning/158104/2 "2021-08-08T18:04:28Z")

</div>

Were you able to resolve this problem?
