As for the Phonegap app for Android and iOS on JS.
We have a server with a method: - Authorize (login, password) that return the certificate.p12 file (PKCS # 12).
The server also has methods that require authorization with this certificate. A Ruby example is as follows:
http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE pkcs12 = OpenSSL::PKCS12.new(File.read('<CERTIFICATE_PATH>'),'') http.cert = pkcs12.certificate http.key = pkcs12.key req = Net::HTTP::Get.new(url.path) result = http.start {|http| result = http.request(req) p result.body }
But how to do it on JS? How to force a method to call JS from Phonegap?
The only solution I found: through plugins in Java and iOS, but I'm not sure if they will work. If so, maybe someone already made them?
source share