1.linux 访问 https 证书问题

[root@boss-test-dev001-jydx ~]# curl -v https://mobile.mycard520.com.tw

* About to connect() to mobile.mycard520.com.tw port 443 (#0)

* Trying 220.130.127.122... connected

* Connected to mobile.mycard520.com.tw (220.130.127.122) port 443 (#0)

* Initializing NSS with certpath: sql:/etc/pki/nssdb

* CAfile: /etc/pki/tls/certs/ca-bundle.crt

CApath: none

* Certificate is signed by an untrusted issuer: 'CN=TWCA Secure SSL Certification Authority,OU=Secure SSL Sub-CA,O=TAIWAN-CA,C=TW'

* NSS error -8172

* Closing connection #0

* Peer certificate cannot be authenticated with known CA certificates

curl: (60) Peer certificate cannot be authenticated with known CA certificates

More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"

of Certificate Authority (CA) public keys (CA certs). If the default

bundle file isn't adequate, you can specify an alternate file

using the --cacert option.

If this HTTPS server uses a certificate signed by a CA represented in

the bundle, the certificate verification probably failed due to a

problem with the certificate (it might be expired, or the name might

not match the domain name in the URL).

If you'd like to turn off curl's verification of the certificate, use

the -k (or --insecure) option.

2.现有 证书twca.cer 需要添加到 linux 证书信任列表

相关证书转换参见:https://netkiller.github.io/cryptography/openssl/format.html

#转换格式 .cer 到 .pem

openssl x509 -inform der -in twca.cer -out twca.pem

#追加到信任列表

cat twca.pem >> /etc/pki/tls/certs/ca-bundle.crt

3.添加后访问成功

[root@boss-test-dev01 certs]# curl -v https://mobile.mycard520.com.tw/billing/RECEIVE.aspx

* About to connect() to mobile.mycard520.com.tw port 443 (#0)

* Trying 220.130.127.122... connected

* Connected to mobile.mycard520.com.tw (220.130.127.122) port 443 (#0)

* Initializing NSS with certpath: sql:/etc/pki/nssdb

* CAfile: /etc/pki/tls/certs/ca-bundle.crt

CApath: none

* SSL connection using SSL_RSA_WITH_RC4_128_MD5

* Server certificate:

* subject: CN=mobile.mycard520.com.tw,OU=IT,O=Soft-World International Corporation,L=Kaohsiung,ST=Taiwan,C=TW

* start date: Apr 29 03:21:58 2015 GMT

* expire date: Nov 12 15:59:59 2017 GMT

* common name: mobile.mycard520.com.tw

* issuer: CN=TWCA Secure SSL Certification Authority,OU=Secure SSL Sub-CA,O=TAIWAN-CA,C=TW

> GET /billing/RECEIVE.aspx HTTP/1.1

> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2

> Host: mobile.mycard520.com.tw

> Accept: */*

>

< HTTP/1.1 200 OK

< Cache-Control: private

< Content-Type: application/json;charset=utf-8

< Date: Tue, 16 Jun 2015 02:52:04 GMT

< Content-Length: 18

< Set-Cookie: NSC_Npcjmf-XfcQ*80=ffffffffaf181f5345525d5f4f58455e445a4a423660;path=/;httponly

<

* Connection #0 to host mobile.mycard520.com.tw left intact

* Closing connection #0

{ "ResultCode":0

4.对于java中如果使用 HttpClient 访问https 可以使用以下命令导入到jre中的作为信任证书

keytool -import -keystore "/usr/local/jdk/jre/lib/security/cacerts" -storepass changeit -keypass changeit -alias twca -file twca.cer

过程中提示是否信任:输入yes即可

Trust this certificate? [no]:

配置过程如下:

[root@boss-test-dev01 ~]# keytool -import -keystore "/usr/local/jdk/jre/lib/security/cacerts" -storepass changeit -keypass changeit -alias twca -file /root/twca.cer

Owner: CN=TWCA Root Certification Authority, OU=Root CA, O=TAIWAN-CA, C=TW

Issuer: CN=TWCA Root Certification Authority, OU=Root CA, O=TAIWAN-CA, C=TW

Serial number: 1

Valid from: Thu Aug 28 15:24:33 CST 2008 until: Tue Dec 31 23:59:59 CST 2030

Certificate fingerprints:

MD5: AA:08:8F:F6:F9:7B:B7:F2:B1:A7:1E:9B:EA:EA:BD:79

SHA1: CF:9E:87:6D:D3:EB:FC:42:26:97:A3:B5:A3:7A:A0:76:A9:06:23:48

Signature algorithm name: SHA1withRSA

Version: 3

Extensions:

#1: ObjectId: 2.5.29.15 Criticality=true

KeyUsage [

Key_CertSign

Crl_Sign

]

#2: ObjectId: 2.5.29.19 Criticality=true

BasicConstraints:[

CA:true

PathLen:2147483647

]

#3: ObjectId: 2.5.29.14 Criticality=false

SubjectKeyIdentifier [

KeyIdentifier [

0000: 6A 38 5B 26 8D DE 8B 5A F2 4F 7A 54 83 19 18 E3 j8[&...Z.OzT....

0010: 08 35 A6 BA .5..

]

]

Trust this certificate? [no]: yes

Certificate was added to keystore

linux添加ssl信任根证书,linux系统添加根证书linux证书信任列表相关推荐

  1. 怎么添加扫描仪到计算机快捷键,Win7系统添加扫描仪快捷方式的方法

    扫描仪想必大家都很熟悉吧,通常被用于计算机外部仪器设备,通过捕获图像并将之转换成计算机可以显示.编辑.存储和输出的数字化输入设备,有时候为了更快的打开扫描仪,我们就可以在桌面你添加扫描仪快捷方式,那么 ...

  2. linux小红帽系统装打印机驱动,Linux系统详解 第三篇:红帽RHEL的安装

    Linux系统详解 第二篇:红帽RHEL的安装 前言: 本系列文章取材广泛,有来自于互联网的,有来自教科书的,有来自自己的笔记的,也有来自自己对Linux的经验积累的.此系列的文章都是经过长时间的整理 ...

  3. Kali Linux 2016.2发布提供虚拟机以及系统镜像下载

    Kali Linux 2016.2发布提供虚拟机以及系统镜像下载 Kali Linux 2016.2发布提供虚拟机以及系统镜像下载,本次Kali Linux 2016.2提供了五种桌面模式,分别为Gn ...

  4. kali linux 虚拟机iso 下载,Kali Linux 2016.2发布提供虚拟机以及系统镜像下载

    Kali Linux 2016.2发布提供虚拟机以及系统镜像下载 Kali Linux 2016.2发布提供虚拟机以及系统镜像下载,本次Kali Linux 2016.2提供了五种桌面模式,分别为Gn ...

  5. 天威诚信-数字证书认证系统iTrusCA

    iTrusCA数字证书认证系统 refurl: http://www.itrus.com.cn/2014/0915/1091.html 1.产品简介 天威诚信数字证书认证系统(下文简称"iT ...

  6. SSL加密与分布式IM系统-InChat1.1.3版本试用说明

    本文首发于本博客 猫叔的博客,转载请申明出处 2019年1月15号-InChat发布V1.1.3版本 InChat 一个轻量级.高效率的支持多端(应用与硬件Iot)的异步网络应用通讯框架 v1.1.3 ...

  7. Windows10系统添加打印机步骤

    1.  打开控制面板→硬件和声音→查看设备和打印机选项. 2.  点击添加打印机选项. 3.  选择我所需的打印机未列出. 4.  选择使用TCP/IP地址或主机名添加打印机,点击下一步. 5.  填 ...

  8. linux ssl证书卸载,Linux的ssl证书安装教程

    SSL证书在不同的系统环境下安装,其操作也是有差异的.系统可分为Linux.Windows等,今天小编要和大家讲的是Linux的ssl证书安装教程,一起来看下. Linux的ssl证书安装教程 Lin ...

  9. 学做Linux内核,Linux内核学习(3) 最小系统制做2 busybox制做initrd.img和根文件系统...

    busybox制做initrd.img和根文件系统 (一)开发环境介绍 1.使用win7_64的笔记本安装Virtualbox虚拟机,笔记本cpu为i5-2450m.虚拟机上安装Ubuntu16.04 ...

最新文章

  1. 管道命令 (pipe)
  2. Android四大组件ContentProvider
  3. 数据库-查看表-创建表-查询表
  4. iOS app 企业内部发布及HTTPS服务器配置
  5. 一起玩转LiteOS组件:Pixman
  6. c++调用python原理_C++调用Python浅析
  7. hive指定hadoop执行队列
  8. pip install -Uqq 是什么意思?
  9. JMeter-配置元件-HTTP授权管理器
  10. linux常用软件收集
  11. 51nod1423 最大二“货”问题
  12. java+如何画一个扇形_实现一个扇形的几种方法
  13. JavaDay13 抽象类 、接口、多态
  14. 清醒看自己,糊涂看别人
  15. java面试题----选择题02
  16. html javascript div 加边框,html div 加边框样式
  17. 公平性、差异性、均衡性的衡量方法
  18. IOS学习之关于导航那些事
  19. ERP在企业中的应用
  20. 手把手教程:解除AppleID「双重验证」

热门文章

  1. SLAM中的卡尔曼滤波:究竟滤了谁?
  2. 详解OpenCV卷积滤波之边缘处理与锚定输出
  3. 用于语义分割的特征共享协作网络
  4. 链表问题12——将单链表的每K个节点之间逆序(方法二)
  5. SpringBoot thymeleaf使用方法,thymeleaf模板迭代
  6. Memcached在Asp.net下的应用
  7. 全球安全行业融资收购简报(2016年2月)
  8. 【UVALive 4642】Malfatti Circles(圆,二分)
  9. ORB-SLAM2实现(kinect V1/ROS)
  10. leetcode 5 :Longest Palindromic Substring 找出最长回文子串