如何在linux系统内用openssl 生成 过期的证书
需求:验证过期的证书在系统中不能使用。
问题:如何生成过期的证书呢?
解决方法:1.调整系统时间
2.生成证书
3.验证证书startdate 和 enddate 是否符合你的预期
1.调整系统时间
1.Set date from the command line:
date +%Y%m%d -s ""
2.Set time from the command line:
date +%T -s "11:14:00"
2. 生成证书
参考连接:https://www.digitalocean.com/community/tutorials/openssl-essentials-working-with-ssl-certificates-private-keys-and-csrs
Generate a Self-Signed Certificate
Use this method if you want to use HTTPS (HTTP over TLS) to secure your Apache HTTP or Nginx web server, and you do not require that your certificate is signed by a CA.
This command creates a 2048-bit private key (domain.key
) and a self-signed certificate (domain.crt
) from scratch:
openssl req \
-newkey rsa: -nodes -keyout domain.key \
-x509 -days -out domain.crt
Answer the CSR information prompt to complete the process.
The -x509
option tells req
to create a self-signed cerificate. The -days 365
option specifies that the certificate will be valid for 365 days. A temporary CSR is generated to gather information to associate with the certificate.
生成证书以后,把 domain.key 和 domain.crt 的内容 复制到 cert.pem 中 上面为 private key,下面为 certificate 部分。
3.把系统时间调整到现在的时间。
4.查看证书的开始时间和过期时间是否如你的预期呢?
openssl x509 -startdate -noout -in key.pem
如何在linux系统内用openssl 生成 过期的证书的更多相关文章
- Linux下使用openssl生成证书
利用OpenSSL生成库和命令程序,在生成的命令程序中包括对加/解密算法的测试,openssl程序,ca程序.利用openssl,ca可生成用于C/S模式的证书文件以及CA文件. 参考:http:// ...
- openssl生成自签名证书
1.生成x509格式的CA自签名证书 openssl req -new -x509 -keyout ca.key -out ca.crt 2.生成服务端的私钥(key文件)及申请证书文件csr文件 o ...
- 使用openssl生成双向加密证书(转)
要生成证书的目录下建立几个文件和文件夹,有./demoCA/./demoCA/newcerts/./demoCA/private/./demoCA/index.txt (空文件,生成证书时会将数据记录 ...
- java验证openssl生成的ssl证书和私钥是否匹配
最近有一个需求上传ssl证书和私钥,但是上传之前需要验证ssl证书和私钥是否正确,其中的业务逻辑涉及到以下几点: 一.读取ssl证书,读取ssl证书公钥 要实现该功能比较简单,java里面 ...
- linux下使用openssl生成 csr crt CA证书
证书文件生成:一.服务器端1.生成服务器端 私钥(key文件);openssl genrsa -des3 -out server.key 1024运行时会提示输入密码,此密码用于加密key文件( ...
- linux下使用openssl生成https的crt和key证书
x509证书一般会用到三类文,key,csr,crt Key 是私用密钥openssl格,通常是rsa算法. Csr 是证书请求文件,用于申请证书.在制作csr文件的时,必须使用自己的私钥来签署申,还 ...
- 用OpenSSL生成自签名证书在IIS上搭建Https站点(用于iOS的https访问)
前提: 先安装openssl,安装有两种方式,第一种直接下载安装包,装上就可运行:第二种可以自己下载源码,自己编译.这里推荐第一种. 安装包:http://slproweb.com/products/ ...
- OpenSSL使用1(用OpenSSL生成自签名证书在IIS上搭建Https站点)(用于iOS的https访问)
前提: 先安装openssl,安装有两种方式,第一种直接下载安装包,装上就可运行:第二种可以自己下载源码,自己编译.这里推荐第一种. 安装包:http://slproweb.com/products/ ...
- Windows下使用OpenSSL生成自签证书
下载OpenSSLhttp://slproweb.com/products/Win32OpenSSL.html 生成证书 生成crt证书CMD进入安装bin目录,执行命令:openssl req -x ...
随机推荐
- 【数据库】4.0 MySQL入门学习(四)——linux系统环境下MySQL安装
1.0 我的操作系统是CentOS Linux release 7.6.1810 (Core) 系统详细信息如下: Linux version 3.10.0-957.1.3.el7.x86_64 ( ...
- ArcGisJS实现地图常用工具条、距离测量和面积测量(非官方实例)
常用地图工具包括:平移.拉框缩小.拉框放大.全图.距离测量.面积测量.清除标记,距离测量.面积测量没有使用官方自带的组件代码. 1.距离测量 2.面积测量 3.源代码 <!DOCTYPE htm ...
- 为mongodb添加账号
进入切换到某一个数据库,我这里是位每个模块分配一个DataBase use 0 执行添加账号命令 db.createUser( { user: "*****", pwd: &quo ...
- 05_Jedis操作Redis
[工程截图] [String类型操作] package com.higgin.string; import java.util.List; import redis.clients.jedis.Jed ...
- Android 从 Web 唤起 APP
前言 知乎在手机浏览器打开,会有个 App 内打开的按钮,点击直接打开且跳转到该详情页,是不是有点神奇,是如何做到的呢? 效果预览 Uri Scheme 配置 intent-filter Androi ...
- 多线程(一)~基础介绍,简单demo实现
前言: 现在CPU都是多核的,可以同时处理多个进程,比如我笔记本的CPU是i3-370,它就是双核四线程的.那么这个核和线程都是什么呢? 核是针对硬件而言的,即核心,代表的 ...
- 常见WEB开发安全漏洞 原因分析及解决
目 录 1 会话标识未更新 3 1.1 原因 3 1.2 解决 3 2 SQL注入 3 2.1 原因 3 2.2 解决 5 3 XSS跨站脚本编制 5 3.1 原因 5 3.2 解决 5 4 XSRF ...
- ORACLE_ALIAS
Oracle / PLSQL: ALIASES website:https://www.techonthenet.com/oracle/alias.php This Oracle tutorial e ...
- 推荐一个很好用的脚本session snapper
源网址http://tech.e2sn.com/oracle-scripts-and-tools/session-snapper 内容: If you want to just download Sn ...
- 查询python的安装路径
参考链接: https://blog.csdn.net/orangleliu/article/details/44907221 (tf_14) novak@novak-ZBook15G2:~$ pyt ...