证书spec, X509, 类似规定了一个目录结构。其中重要内容包括

  • issuer: who isued this certificate
  • subject: the ID of this certificate
  • public key:
  • validate period
  • sign: the sha of this certificate, encritpted with the issuer's private key. (This is the mechanism how to verify the certificate)
  • in extention, other there is a link to get certificate of issuer.

DN (distingushed name)

  • include C(country), ST(state), O(organization), OU(部门,可以多个), CN(common name)
  • both Issuer and Subject are DN.

Certificate formate

  • PEM, base64 encoded DER file, easy to be edited
  • DER, CER, CRT.  same, DER, Distinguished Encoding Rules. openssl -inform der -in a.cert -text -noout
  • P12. Windows specific, contails both public key and private key. So the file itself should be encriypted.
  • p7b, p7c. CRL (certificate revocation list) 常用于证书吊销文件,不包括key
  • JKS. Java Key storage(Java 专利)利用 keytool 管理

应用

  1. Safari and macOS, managed by "keychain access". The each keychain is stored in separated directory. login means the current login user.
  2. Java, keytool 管理,has different location from OS(e.g. /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/security/cacerts), so even safari downloaded a Root CA for a website, Java may still not work.  
    1. keytool -list -keystore cacerts
  3. Python: 
    1. public certs stored in certifi module ([py_home]/site-packages/certifi/cacert.pem), then all python modules relying on certifi (e.g. requests) could load certs for ssl verification
    2. However, pip is a standalone package that contains its own requests/certifi module and public cert storage.  One solution is to wrap original certifi.where() and pip._vendor.requests.certs.where() method to force return path ‘/etc/pki/tls/cert.pem’. Make sure all certs are store in it.
  4. CN name: https://security.stackexchange.com/questions/40026/openssl-x509-whats-the-significance-of-cn-common-name
  5. curl, use curl -v to see with cacert it is using, maybe /etc/ssl/cacert.pem, makeby $HOME/anaconda/ssl/cacert.pem. 
    1. 手动指定使用某个证书来验证网站 curl --cacert mycertificate.cer -v https://www.google.com

References:

  • cert format,

    • https://serverfault.com/questions/9708/what-is-a-pem-file-and-how-does-it-differ-from-other-openssl-generated-key-file
    • https://www.cnblogs.com/guogangj/p/4118605.html
  • https://en.wikipedia.org/wiki/X.509  (X.509 内容说明) , 
    •  PKIX (Public Key Infrastructure X.509)
    •  OCSP (Online Certificate Status Protocol)
  • verify certificate: https://stackoverflow.com/questions/188266/how-are-ssl-certificates-verified
  • Certificate Chain: 
    • https://ssl.comodo.com/articles/understanding-an-ssl-certificate-chain.php
    • https://support.dnsimple.com/articles/what-is-ssl-certificate-chain/

Root certificate

  • Intermediate certifcate

    • client certificate. In SSL, webserver might need to veifiy the certificate of the client. Usually it doesn't.

About certificate的更多相关文章

  1. 钉钉开放平台demo调试异常问题解决:hostname in certificate didn't match

    今天研究钉钉的开放平台,结果一个demo整了半天,这帮助系统写的也很难懂.遇到两个问题: 1.首先是执行demo时报unable to find valid certification path to ...

  2. 异常处理之“The remote certificate is invalid according to the validation praocedure.”

    参考文章:http://brainof-dave.blogspot.com.au/2008/08/remote-certificate-is-invalid-according.html 参考文章:h ...

  3. The certificate used to sign ***has either expired or has been revoked. An updated certificate is required to sign and install the application

    真机测试的时候弹出这样的提示:The certificate used to sign ***has either expired or has been revoked. An updated ce ...

  4. Domino----The Address Book does not contain a cross certificate capable of validating the public key.

    The Address Book does not contain a cross certificate capable of validating the public key. 地址本不包含交叉 ...

  5. Your account already has a valid iOS Distribution certificate!

    iOS 发布提交出现:Your account already has a valid iOS Distribution certificate!问题解决 转载的链接   http://www.jia ...

  6. configure Git to accept a particular self-signed server certificate for a particular https remote

    get the self signed certificate put it into some (e.g. ~/git-certs/cert.pem) file set git to trust t ...

  7. [nodejs] Error: unable to verify the first certificate

    Error: unable to verify the first certificate Solution npm config set registry http://registry.npmjs ...

  8. Rails 之微信开发 : OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

    微信公众平台,使用Ruby On Rails + Win7 在取得OpenID时,如果简单的使用http.get方法,会出现如下 SSL_connect returned=1 errno=0 stat ...

  9. Fiddler 手机端证书安装No root certificate was found

    测试过程中发现在浏览器中访问代理服务器及端口,不通,提示要安装证书. 点击证书安装时,提示错误: No root certificate was found,Have you enabled HTTP ...

  10. 关于Certificate、Provisioning Profile、App ID的介绍及其之间的关系

    1.概念介绍 如果你拥有一个开发者账户的话,在iOS Dev Center打开Certificates, Indentifiers & Profiles,你就可以看到如下的列表: Profil ...

随机推荐

  1. DRF框架之 用户角色权限与访问频率的权限设置

    1. 简单演示,创建一个models的数据库表 class User(models.Model): name=models.CharField(max_length=32) pwd=models.Ch ...

  2. Redis 4.0.2.3 for Windows (alpha) 下载地址

    下载地址如下: https://github.com/tporadowski/redis/releases 如果直接使用redis-server.exe启动报错的话,就使用redis-server.e ...

  3. Django应用app创建及ORM

    一.重要知识点回顾: 1. form表单提交数据的注意事项: 1. 是form不是from,必须要有method和action (action用来指定你的数据提交到后台哪个地方,method用来指定你 ...

  4. Chrome添加Axure RP插件

    之前一直用 Firefox 浏览器浏览原型文件,一直用不惯,而且用 Firefox 的唯一目的就是看原型.其他都是用 Chrome 浏览器,来回切换,各种麻烦,然后下定决心解决 Chrome 浏览器无 ...

  5. docker使用flannel网络

    基础环境我们使用了两台centos 7系统 基础配置为: 两台机器IP为 172.17.3.10 172.17.3.62 hosts文件配置为 172.17.3.10 node1 172.17.3.6 ...

  6. (译)MySQL的10个基本性能技巧

    原文出处:https://www.infoworld.com/article/3210905/sql/10-essential-performance-tips-for-mysql.html MySQ ...

  7. Alpha冲刺

    第一天 日期:2018/6/16 1.今日完成任务情况以及遇到的问题 张天旭:根据系统的需求,完成数据库的设计 周甜甜:完成系统后台登录界面的设计及登录功能的实现 李蕾:完成系统后台首页的设计 张海鑫 ...

  8. nginx 做数据仓库时,location 404 Not Found,发现找不到要用的数据报:Not Found

    背景:  获得远程机器某个目录下的数据文件 方案:使用Nginx配置 1./home/ftp/www/ 下面有images 文件夹,为了访问images下面文件,配置Nginx如下: location ...

  9. Java框架spring学习笔记(十七):事务操作

    事务操作创建service和dao类,完成注入关系 service层叫业务逻辑层 dao层单纯对数据库操作层,在dao层不添加业务 假设现在有一个转账的需求,狗蛋有10000元,建国有20000元,狗 ...

  10. pyautogui 文档(三):键盘控制

    typewrite()函数 主要的键盘功能是typewrite().此函数将键入字符串中传递的字符.要在按下每个字符键之间添加延迟间隔,请为interval关键字参数传递int float . > ...