This article describes the steps to import self-signed certificate created on SRX in Firefox web-browser on Ubuntu OS. Refer creation of self-signed-certificate on SRX.
For importing this certificate in Firefox web-browser on Ubuntu OS, follow the steps below: Step1: Export the certificate from the SRX device in .pem format and the key-pair root@SRX# run request security pki local-certificate export certificate-id SRXasCA filename /var/tmp/SRXasCA.pemcertificate exported successfullyroot@SRX# run request security pki key-pair export certificate-id SRXasCA filename /var/tmp/SRXasCA.key type pem passphrase Juniper@12345key-pair exported successfullyroot@SRX# run file list /var/tmp/ | match SRXSRXasCA.keySRXasCA.pemStep2: Move these files to the Ubuntu machine (you can use SCP or other similar methods)labroot@Ubuntu20:~$ ls | grep SRXSRXasCA.keySRXasCA.pemFirefox browser on the Ubuntu OS needs a .crt file, therefore make a copy of the certificate in .crt formatlabroot@Ubuntu20:~$sudo cp SRXasCA.pem SRXasCA.crtNow, you should see the below files: labroot@Ubuntu20:~$ ls | grep SRXSRXasCA.crtSRXasCA.keySRXasCA.pemStep3: Move the key-pair to the /etc/ssl/private/ directory on the Ubuntu machine.labroot@Ubuntu20:~$ sudo cp SRXasCA.key /etc/ssl/private/Step4: Create a new directory under /usr/share/ca-certificate directory. This directory can be named as anything of your choice, however we have created a directory named “extra”.labroot@Ubuntu20:~$ sudo mkdir /usr/share/ca-certificate/extraStep5: Copy the ".CRT" certificate file from Step 2 to /usr/share/ca-certificate/extra and /usr/share/ca-certificate/Mozilla directory.labroot@Ubuntu20:~$ sudo cp SRXasCA.crt /usr/share/ca-certificates/extra/labroot@Ubuntu20:~$ sudo cp SRXasCA.crt /usr/share/ca-certificates/mozilla/Step6: Reconfigure CA certificatelabroot@Ubuntu20:~$ sudo dpkg-reconfigure ca-certificatesSelect the newly added cert and follow the instruction on the wizard
Ensure that the requires certificates are selected (have an asterisk), you can do this by pressing ‘spacebar’Make sure that both the SRXasCA.crt files are selected (under directories extra/ and mozilla/)Then press ’Tab’ to select ‘OK’ and press ‘Enter’Step7: Next update the CA certificate by running following command:labroot@Ubuntu20:~$ sudo update-ca-certificates Updating certificates in /etc/ssl/certs...2 added, 0 removed; done.Running hooks in /etc/ca-certificates/update.d...done.Step8: Now open the Firefox web-browser and go to Certificate Manager > Authorities > Import Select the “.crt” file and then select “Trust this CA to identify websites” and Click “OK”
Now, the certificate is successfully imported.