Testing
To build OMA using the non-PWA version (dist/oma/www) and to serve it from an http:// server:
1. Build OMA as a non-PWA non-Optimiuzed app using this command:
./oma2_build.sh -oma
2. To serve OMA from a test http serve, run this command:
ojet serve web
OMA will open in a browser on your device at this address: http://localhost:8000
OMA running as a PWA requires it to be served from an https:// server. This is a general requirement of all PWA applications.
The https:// server must meet these requirements:
It must be running on a system with a Fully Qualfied Domain Name (FQDN, ie nms-host.oracle.com).
The FQDN must be registered with your systems DNS server.
The FQDN must appear in the Subject Alternate Name (SAN) attribute of the https/ssl certificate.
Here is a summary of how to build OMA using the PWA non-optimized version and to serve it from an https:// server:
1. Build OMA as a non-PWA non-Optimized app using this command:
./oma2_build.sh -oma -pwa
Generate an https/ssl self signed certificate using your systems DNS registered FQDN. Here is an example of how to do that:
openssl req -new -newkey rsa:2048 -new -nodes -x509 -days 3650 -passout pass:1234 -keyout key.pem -out cert.pem -subj "/C=US/CN=nmshost.oracle.com" -addext "subjectAltName = DNS:nmshost.oracle.com"
If you are running a very old version of openssl, it may not support the -addext option, you may need to update your system to a newer version of openssl. openssl added support for -addext in version 1.1.1 in 2018.
2. To serve OMA from a test http serve, run this command:
ojet serve web
OMA will open in a browser on your device at this address: https://localhost:8000. Change the address in the browser address bar to your FQDN (https://nmshost.oracle.com:8000).
3. In most cases, your browser will indicate in the address bar that the https/ssl certificate is not trusted. Install your SSL certificate into your systems trusted certificate store.
For Windows Systems
1. From the browser tab running OMA from the FQDA https server, right click in the address bar on the "Not Secure" area. From Chrome, click on "Certificate is not valid" and the certificate details will popup. From Edge, click on "Your connection to this site isn't secure" and it will popup an dialog, click the certificate icon on the header bar, and the certificate details will popup.
2. From the certificate details popup, goto the details tab and hit the Copy to File... and the Certificate Export Wizard will popup. Click Next, select DER encoded binary, click Next, enter file path or browse to a file location and enter a a name (ie C:\cert.cer), click Next and then Finish.
3. From the Windows start menu, enter Certificates an click on Manage Computer Certificates. The certlm app will popup.
4. Select "Trusted Root Certificates" on the left column and from the Action menu, select All Tasks and then Import... The Certificate Import Wizard will appear.
5. From the Certificate Import Wizard popup, select Next, enter or browse to the file where you saves the certificate (ie C:\cert.cet) and click Next, Select Place all certificates in the following store, then click Browse... and click "Trusted Root Certificate Authorities" and OK, then Next, and Finish.
For Oracle Linux with Chrome:
1. From the browser tab running OMA from the FQDN server, click on the address bar on the "Not Secure" area, and then click on "Certificate". The certificate viewer will popup.
2. In the Certificate Viewer, click on the details tab, and scroll down to the bottom and click Export... then navigate to a place to save the certificate, on the bottom of the dialog select "DER-encoded binary, single certificate" and click save.
3. From a terminal on the client running Chrome, run the following command to import the certificate:
certutil -d sql:$HOME/.pki/nssdb -A -t TCuc -i ~/Downloads/nmshost.oracle.com -name nmshost.oracle.com
4. Restart Chrome and reload the OMA, you will now be running OMA as a real PWA.