Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to install certificate in browser settings using command prompt?

I have added the certificate successfully using command prompt(example below). But I could not found the same certificate in chrome browser settings("Setting/HTTPS/SSL/Manage certificates/"), in all tabs.

How to install the certificate in browser settings ("settings/"HTTP/SSL/Manage certificates/") via command prompt? Am using "windows xp"

import certificate:-- "C:\Program Files\Java\jre7\bin\keytool" -import -keystore cacerts -file test.cer

like image 589
Maria Avatar asked Oct 30 '13 20:10

Maria


People also ask

How do I manually install a certificate?

Import the certificate into the local computer storeOn the File menu, select Add/Remove snap-in. In the Add/Remove Snap-in dialog box, select Add. In the Add Standalone Snap-in dialog box, select Certificates, and then select Add. In the Certificates snap-in dialog box, select Computer account, and then select Next.

Where is install Certificates command?

To install certifi Python on Microsoft Windows: Type cmd in the search bar and hit Enter to open the command line. Type python3 -m pip install certifi in the command line and hit Enter again. This installs certifi for your default Python installation.

How do I download SSL certificate from command line?

I found the answer. Openssl provides it. sudo rm -f cert. pem && sudo echo -n | openssl s_client -connect localhost:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ./cert.


1 Answers

According to this blog post it sounds like the technique is identical for Chrome as well, "Adding SSL certificates to Google Chrome Linux (Ubuntu)". The directions from that post were specific to Ubuntu but should be easily adapted to other Linux variants.

NOTE: Much of the contents below was excerpted from this article!

1. Add Software

$ sudo apt-get install libnss3-tools
$ sudo apt-get install curl

2. Adding CAcert certificates

$ curl -k -o "cacert-root.crt" "http://www.cacert.org/certs/root.crt"
$ curl -k -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org" -i cacert-root.crt 
$ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org Class 3" -i cacert-class3.crt

3. Create script

This will download and import the certificate into the certificate DB. We're calling the script: import-cert.sh.

#!/bin/sh
#
# usage:  import-cert.sh remote.host.name [port]
#
REMHOST=$1
REMPORT=${2:-443}
exec 6>&1
exec > $REMHOST
echo | openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "$REMHOST" -i $REMHOST 
exec 1>&6 6>&-

4. Adding certs

You can now run this script like so.

  1. To add a certificate from a site you type the following:

    $ import-cert.sh dirae.lunarservers.com 2083
    

    In this case it uses port 2083 instead of the default port 443. If it’s the default port you don’t have to include the port.

  2. To see which certificates are included your database:

    $ certutil -L -d sql:$HOME/.pki/nssdb
    
  3. And should you want to delete a certificate

    $ certutil -D -n  -d sql:$HOME/.pki/nssdb
    

References

  • LinuxCertManagement - Chromium
like image 100
slm Avatar answered Oct 05 '22 00:10

slm