1

I have been trying to set up Selenium to access an ssl protected service via firefox. To do this, it looks like I need to

I am capable of setting up a firefox profile via the GUI in such a way that will allow me to access the server, but I need to use a firefox instance that runs on a GUI-less CentOS server.

To set up the certificates from the GUI I go to Options->Privacy & Security->Certificates->View Certificates. I then go to the "Your Certificates" tab, click "Import", search my machine for the certificate "client1.p12". I then enter the password for the file and click "OK".

I was wondering if there was a command-line way of performing the above actions.

somexp12
  • 497
  • 1
  • 6
  • 19
  • You can find here [https://developer.mozilla.org/en-US/Firefox/Headless_mode] examples of how to use firefox in headless mode, using javascript and selenium. – Pierre François Mar 05 '18 at 14:08
  • Duplicate of https://stackoverflow.com/questions/1435000/programmatically-install-certificate-into-mozilla. This issue briefs about certutil way, which works for both windows and Linux. – Akshay barahate Mar 18 '19 at 14:15

2 Answers2

0

To any onlookers, this was resolved with a work-around.

I simply acquired a CentOS server with a desktop and set up the profile there. I then copied the profile from the .mozilla folder on the server I set it up in to the .mozilla folder in the gui-less CentOS server.

If I ever find the command line method for doing this, I'll post it here in case there is anyone else trying to accomplish this.

somexp12
  • 497
  • 1
  • 6
  • 19
0

This seems to be doable with pk12util (from nss-tools):

$ pk12util -d ~/.mozilla/firefox/foo.default -i /path/to/export-file.p12

source: https://www.dzhang.com/blog/2011/01/29/importing-exporting-firefox-certificates-from-command-line

proycon
  • 495
  • 3
  • 9