Hi All,

This blog tells about how to disable trusted certificate path in mobile/tablet.

What is HTTPS protocol:


                                               Hypertext Transfer Protocol Secure (HTTPS) is a communications protocol for secure communication over a computer network, with especially wide deployment on the Internet. Technically, it is not a protocol in and of itself; rather, it is the result of simplylayering the Hypertext Transfer Protocol (HTTP) on top of the SSL/TLS protocol, thus adding the security capabilities of SSL/TLS to standard HTTP communications. The main motivation for HTTPS is to prevent wiretapping and man-in-the-middle attacks.


If you dont have certificate path. This may cause problem to download file, image, videos from HTTPS secure connection.


Solution:


By Using File transfer plugin, we can avoid this problem.


Steps:


var downloadUrl = “https://YOURHOSTNAME/ SAPPATH /File(‘MYPDFFILE’)/$value”;

fileTransfer.download(

  downloadUrl,

  fileSystem.root.toURL() + ‘/’ + relativeFilePath,

  function (entry) {

  var finalRes = fileSystem.root.toURL() + ‘/’ + relativeFilePath;

  //Success

  },

  function (error) {

  alert(“Error during download. Code = ” + error.code);

  },

true// MAKE THIS AS TRUE ( THIS IS THE FLAG TO DOWNLOAD FILES FROM HTTPS SECURE CONNECTION)

  );



https://github.com/apache/cordova-plugin-file-transfer/blob/master/doc/index.md#download

Go to this link, download this plugin to your Android/Cordova CLI project.



This makes you very  easy to download your file from Secure connection.


Thanks,

Karthik A

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply