Skip to content Skip to sidebar Skip to footer

Error Uploading File Using Cordova Filetransfer In Ssl Environment

I'm facing an issue while trying to use the Cordova File Transfer API to upload a file while the Worklight Development Server is running in HTTPS. I created a certificate with a va

Solution 1:

That error means that you did not use your server's host name as the CN for the certificate. Android verifies that the CN (common name) matches the host name, otherwise the certificate is not valid, as it could be any other server using your certificate to pretend that they are you (more information about this here).

If your server does not have a host name (as in hostname.com), just an IP address, you have to specify the IP in the Subject Alternative Name (SAN) as part of the certificate extenstions. Refer to this answer on how to add it as an extension. The exact procedure will depend on the tool you used to generate the certificate.

For more detailed information, look here at the android documentation on how to deal with HTTPS and SSL. Particularly, they have a section explaining how to deal with the problem that you are having, titled 'Common Problems with Hostname Verification'.

Post a Comment for "Error Uploading File Using Cordova Filetransfer In Ssl Environment"