wymsee / cordova-HTTP

Cordova / Phonegap plugin for communicating with HTTP servers. Allows for SSL pinning!
MIT License
372 stars 301 forks source link

How to use ssl certificate and https in this library #140

Open Vishnuneelancheri opened 7 years ago

Vishnuneelancheri commented 7 years ago

I want to use SSL certificate and https connection. How can I ?

mike-roberts commented 7 years ago

If you're using cordova-android@6.2.1 or higher and/or cordova-ios@4.4.0 or higher you can use the new resource-file tag in config.xml.

https://cordova.apache.org/docs/en/latest/config_ref/index.html#resource-file

as an example in my config.xml I have:

    <platform name="android">
        <resource-file src="path/to/certfile.cer" target="assets/cerfile.cer" />
    </platform>
    <platform name="ios">
        <resource-file src="path/to/certfile.cer" />
    </platform>

This puts the files in the correct places thanks to the resource-file tag.

To use the https part, just make sure you're connecting to an https url.

stevenballs commented 6 years ago

if ios 4.2 how solve it ?