Add Private HTTPS certificate to an Oracle Mobile Application Framework (MAF) App

If you get this error:

“Certificate was issued by an unrecognized entity”

when connecting an Oracle Mobile Application Framework (MAF) app with a server via HTTPS, you need to retrieve and package the server certificate with the app.

The Oracle MAF cacerts file identifies a set of certificates from well-known and trusted sources to JVM 1.4 and enables deployment. For an application that requires custom certificates (such as in cases where RSA cryptography is not used), you must add private certificates before deploying the application.

  1. Retrieve the cert from the server.
    openssl s_client -connect <server>:<port> -showcerts

    Copy-paste the certificate to a file “cert_file”: the output between —–BEGIN CERTIFICATE—— and —–END CERTIFICATE——, inclusive.

  2. Add the cert to the certs store.
    Change directory to <MAF app root>/resources/security. There is a “carets” file there.

     keytool -importcert -keystore cacerts -file cert_file -storepass changeit -noprompt
  3. Redeploy