如何使用命令提示符在浏览器设置中安装证书? [英] how to install certificate in browser settings using command prompt?

查看:206
本文介绍了如何使用命令提示符在浏览器设置中安装证书?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用命令提示符(以下示例)成功添加了证书。但是在所有标签页的Chrome浏览器设置(设置/ HTTPS / SSL /管理证书/)中找不到相同的证书。

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.

请告诉我如何通过命令提示符在浏览器设置( settings / HTTP / SSL / Manage certificate /)中安装证书。 Windows xp

Could you please advise me, how to install the certificate in browser settings ("settings/"HTTP/SSL/Manage certificates/") via command prompt. Am using "windows xp"

导入证书:-
C:\Program Files\Java\jre7\bin \keytool -import -keystore cacerts -file test.cer

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

感谢您对此进行调查。

推荐答案

根据此博客文章,听起来该技术也适用于Chrome, 向Google Chrome Linux(Ubuntu)添加SSL证书

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!

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



2。添加CAcert证书



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。创建脚本



这将下载证书并将其导入证书数据库。我们正在调用脚本: 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。添加证书



您现在可以像这样运行此脚本。

4. Adding certs

You can now run this script like so.


  1. 要从站点添加证书,请键入以下内容:

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

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

在这种情况下,它使用端口2083而不是默认端口443。如果这是默认端口,则不

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.

要查看数据库中包含哪些证书:

To see which certificates are included your database:

$ certutil -L -d sql:$HOME/.pki/nssdb


  • 并且您是否要删除证书

  • And should you want to delete a certificate

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




  • 参考




    • LinuxCertManagement-Chromium

    • References

      • LinuxCertManagement - Chromium
      • 这篇关于如何使用命令提示符在浏览器设置中安装证书?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆