使用Letsencrypt做SSL certificate
为什么要使用Letsencrypt做SSL certificate?
最简单直接的原因是免费。但是免费存在是否靠谱的问题,尤其是对安全要求比较高的网站,需要考虑使用letsencrypt的安全性是否符合你的标准。本文旨在介绍怎么使用letsencrypt做SSL certificate,或者说是letsencrypt学习笔记更适合,对其适用场景没有做过多研究。
从git上下载letsencrypt到服务器上
$ git clone https://github.com/letsencrypt/letsencrypt
进到letsencrypt目录下,使用一下命令来创建以及安装CA
$ ./letsencrypt-auto certonly
$ ./letsencrypt-auto --apache -d domainName
CA的一些文件在 /etc/letsencrypt 目录下。
这样就可以以https方式访问你指定的域名了。
但是,网站内可能存在一些http请求,浏览器会报错并加载不成功。这里,我的做法是将站内所有的http请求重定向到https请求。我们需要修改apache2的配置文件。
打开000-default.conf文件,
/etc/apache2/sites-enabled/-default.conf
加上
RewriteEngine On
RewriteRule ^/(.*)$ https://domainname/$1 [R,L]
修改tomcat下的server.xml文件
<Connector URIEncoding="UTF-8" port="" protocol="HTTP/1.1"
connectionTimeout=""
compression="on"
compressionMinSize=""
compressableMimeType="application/json,application/javascript,application/xml,image/gif,image/png,text/css,text/html,text/javascript,text/plain,text/xml"
redirectPort=""
proxyPort = "" scheme="https"/>
这样网站所有的请求都指向https请求了。
letsencrypt默认30天内有效,但有renew的命令可以在letsencrypt过期之后更新CA。自动更新CA的脚本如下
#!/bin/sh
if ! /path/to/letsencrypt-auto renew > /var/log/letsencrypt/renew.log >& ; then
echo Automated renewal failed:
cat /var/log/letsencrypt/renew.log
exit
fi
需要在服务器上定期执行这个脚本,可以使用crontab。
使用Letsencrypt做SSL certificate的更多相关文章
- 用 letsencrypt 生成 SSL 证书
letsencrypt 生成 SSL 证书 事先配置好访问域名解析 在nginx 对应虚拟主机添加一个验证区域: 配置 nginx server { listen 80; ... location ~ ...
- How To Create a SSL Certificate on Apache for CentOS 6
About Self-Signed Certificates 自签证书.一个SSL证书,是加密网站的信息,并创建更安全的链接的一种方式.附加地,证书可以给网站浏览者显示VPS的的身份证明信息.如果一个 ...
- last error : SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate veri
今天在用搜狐提供的邮件群发系统的sdk,做发送邮件的测试时,提示: last error : SSL certificate problem, verify that the CA cert is O ...
- curl: (60) SSL certificate problem: unable to get local issuer certificate 错误
今天同事做微信管理的项目,请求接口返回如下错误SSL certificate problem: unable to get local issuer certificate. 此问题的出现是由于没有配 ...
- PySpider 框架爬虫错误 HTTP 599: SSL certificate problem: unable to get local issuer certificate解决方案
首先pyspider all启动pyspider的所有服务,然后访问http://localhost:5000创建一个爬虫任务:taobaomm,点开任务链接编辑http://localhost:50 ...
- 使用 OpenSSL为WindowsServer远程桌面(RDP)创建自签名证书 (Self-signed SSL certificate)
前言 笔者查阅很多资料,才写成此文章,如有错误,请读者们及时提出. 一般大家使用远程桌面(Remote Desktop)连接Windows Server时,总会有一个警告提示,如图1 图1 出现此警告 ...
- ...cURL error 60: SSL certificate problem: unable to get local issuer certificate...
问题描述: 在做PHP爬虫的时候, 安装了 guzzle 和 dom-crawler 之后, 调用的时候出现问题, 如下 报错内容: Fatal error: Uncaught GuzzleHttp ...
- SSL certificate problem unable to get local issuer certificate解决办法
SSL certificate problem unable to get local issuer certificate 解决办法: 下载:ca-bundle.crt 将它放在自己的wamp或者x ...
- How To Set Up Apache with a Free Signed SSL Certificate on a VPS
Prerequisites Before we get started, here are the web tools you need for this tutorial: Google Chrom ...
随机推荐
- 属性锁TimeLock
属性锁TimeLock 这是本人所写的几个类,用于对属性设置值时进行锁定与解锁,适用于高逼格动画当中. 源码: TimeLock.h 与 TimeLock.m // // TimeLock.h // ...
- editplus 格式化 js、html、xml、css
没有文件扩展”js”的脚本引擎的问题的解决办法 解决办法如下: 打开注册表编辑器,定位"HKEY_CLASSES_ROOT" > ".js" 这一项,双击 ...
- redis持久化方法
1.redis持久化,来自官方说明 如何选择使用哪种持久化方式? 一般来说, 如果想达到足以媲美 PostgreSQL 的数据安全性, 你应该同时使用两种持久化功能. 如果你非常关心你的数据, 但仍然 ...
- dynamic_cast动态转换
我们都知道dynamic_cast会在运行时进行类型检查,比较安全,static_cast静态转换,不安全 dynamic_cast转换的类型必须是个类,且这个类中必须有虚函数,为什么呢? 虚函数对于 ...
- Oracle 查找带有CLOB字段的所有表
查找带有CLOB字段的以HEHE开头的所有表 select t.column_name ,DATA_TYPE,TABLE_NAMEfrom user_tab_columns twhere t.TABL ...
- Codeforces Round #436 (Div. 2)【A、B、C、D、E】
Codeforces Round #436 (Div. 2) 敲出一身冷汗...感觉自己宛如智障:( codeforces 864 A. Fair Game[水] 题意:已知n为偶数,有n张卡片,每张 ...
- 在一个应用中如果同一个Spring 的IOC容器被实例化两次就会出现 CannotAcquireResourceException 异常
现象描述:我在一个Junit 的测试类中实例化IOC容器 : ac = new ClassPathXmlApplicationContext("applicationContext.xml& ...
- EmailMessage类
EmailMessage类 EmailMessage类 实例化有以下参数,注:以下所有参数都是可选的并且可以在send()方法之前任意时间设置. subject: email的主题 body: 主体内 ...
- OpenXml操作Excel
要使用OpenXml首先要下载最新的Open XML Format SDK 2.0.具体的导入openxml的dll,去网上搜,很多 1.我个人写的XmlHelp类 using System; usi ...
- PHP数组和字符串相互转换以及判断字符串长度
这里只介绍最常用的方法: $array=explode(separator,$string); $string=implode(glue,$array); explode() 函数用来将字符串打散成数 ...