最近需要SSL证书,又不想花钱买,正好看到linux基金会去年底上线了新的开源项目,免费推广SSL遂尝试。

Let's Encrypt 介绍

Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. It is a service provided by the Internet Security Research Group (ISRG).

We give people the digital certificates they need in order to enable HTTPS (SSL/TLS) for websites, for free, in the most user-friendly way we can. We do this because we want to create a more secure and privacy-respecting Web.

The key principles behind Let’s Encrypt are:

Free: Anyone who owns a domain name can use Let’s Encrypt to obtain a trusted certificate at zero cost.
Automatic: Software running on a web server can interact with Let’s Encrypt to painlessly obtain a certificate, securely configure it for use, and automatically take care of renewal.
Secure: Let’s Encrypt will serve as a platform for advancing TLS security best practices, both on the CA side and by helping site operators properly secure their servers.
Transparent: All certificates issued or revoked will be publicly recorded and available for anyone to inspect.
Open: The automatic issuance and renewal protocol will be published as an open standard that others can adopt.
Cooperative: Much like the underlying Internet protocols themselves, Let’s Encrypt is a joint effort to benefit the community, beyond the control of any one organization.
We have a page with more detailed information about how the Let’s Encrypt CA works.

以下内容来源于dockhub上的xataz/letsencrypt,有修改

1.编辑Dockerfile如下(部分内容来源于网络:xazta)

FROM alpine:3.5

ENV CERTBOT_VER v0.11.1

LABEL description="Letsencrypt based on alpine" \
tags="latest 0.11.1 0.1" \
maintainer="shawn.qian" \
build_ver="2017022401"

RUN BUILD_DEPS="py2-pip \
gcc \
musl-dev \
python2-dev \
libffi-dev \
openssl-dev" \
&& apk add -U ${BUILD_DEPS} \
tini \
dialog \
python \
libssl1.0 \
&& pip install --no-cache virtualenv \
&& virtualenv --no-site-packages -p python2 /usr/certbot/venv \
&& /usr/certbot/venv/bin/pip install --no-cache-dir certbot==$CERTBOT_VER \
&& pip uninstall --no-cache-dir -y virtualenv \
&& apk del ${BUILD_DEPS} \
&& rm -rf /var/cache/apk/* /root/.cache/pip

EXPOSE 80 443
VOLUME /etc/letsencrypt/

ENTRYPOINT ["/sbin/tini","--","/usr/certbot/venv/bin/certbot"]
CMD ["--help"]

保存文件,运行

docker build -t yourreposname/letsencrypt

安静等待build完成

2. 执行

sudo docker run -it --rm \

-v /etc/letsencrypt:/etc/letsencrypt \

-p 443:443 yourreposname/letsencrypt certonly \

--standalone \

--agree-tos

\-m yourmailadd@mail.com

\-d your.domain.com

P.S

1.本案例使用443端口,请保持你的443端口畅通,成功后会在/etc/letsencrypt下生成live/your.domain.com文件夹,里面就是你的证书文件了。

2. yourreposname/letsencrypt 其中"yourreposname"改成你的仓库名

cert.pem 申请的服务器证书文件

privkey.pem 服务器证书对应的私钥

chain.pem 除服务器证书外,浏览器解析所需的其他全部证书,比如根证书和中间证书

fullchain.pem 包含服务器证书的全部证书链文件

Letsencrypt SSL免费证书申请(Docker)的更多相关文章

  1. SSL免费证书申请以及nginx配置https流程记录

    设置https需要ssl 证书,可以通过FreeSSL[https://freessl.org/]申请. 流程记录: 输入域名,如 http://www.youdias.xin 选择品牌,如Let's ...

  2. HTTPS(SSL / TLS)免费证书申请及网站证书部署实战总结

    服务器环境:windows server 2008  +  tomcat7 废话不多说,先看部署效果: 一.免费证书申请 Let's Encrypt  简介:let's Encrypt 是一个免费的开 ...

  3. 转自《https安全链接的配置教程:startSSl免费证书申请与nginx的https支持配置》

    一.什么是 SSL 证书,什么是 HTTPS 网站? SSL证书是数字证书的一种,类似于驾驶证.护照和营业执照的电子副本.SSL证书通过在客户端浏览器和Web服务器之间建立一条SSL安全通道(Secu ...

  4. Nginx启用ssl以及免费证书申请

    主要是这个东西,折腾了我两天,所以记录下来. 最开始是在meteor下面调用一个webservice,但是发现meteor项目的发布环境时https,所以请求的webservice也必须时webser ...

  5. 免费证书申请——Let's Encrypt的申请与应用(IIS,Tomcat)

    环境 Windows Server 2008 R2 Tomcat 8.5.31 JDK8 利用IIS+letsencrypt-win-simple.V1.9.1申请免费SSL证书 新建一个IIS空网站 ...

  6. iOS https认证 && SSL/TLS证书申请

    1.下面列出截止2016年底市面上常见的免费CA证书: 腾讯云SSL证书管理(赛门铁克TrustAsia DV SSL证书)阿里云云盾证书服务(赛门铁克DV SSL证书)百度云SSL证书服务Let's ...

  7. Java Web学习总结(31)——全站HTTPS化SSL免费证书使用

    1 背景 谷歌从 2017 年起,Chrome 浏览器将也会把采用 HTTP 协议的网站标记为「不安全」网站:苹果从 2017 年 iOS App 将强制使用 HTTPS:在国内热火朝天的小程序也要求 ...

  8. 阿里云使用ssl免费证书

    购买免费证书 购买之后 申请证书 该域名必须添加一条TXT记录 根据提示添加记录 下载证书 我用的nginx做的映射,所以下载nginx nginx安装自行百度 将下载的文件解压到nginx目录下(创 ...

  9. StartSSL免费证书申请笔记

    第一步:申请startssl账号 填写相应信息后,你所填写的邮箱会收到邮件 里面有一个用来验证的验证码 输入得到的.... 注册成功后会安装数字证书(注意:注册过程中没有叫输入账号密码,这也是通过证认 ...

随机推荐

  1. jquery+jquery.rotate实现图片旋转效果

    首先要下载jquery.min.js 和jquery.rotate.js文件 1.下载地址: https://www.jb51.net/jiaoben/554113.html 2.导入文件 <s ...

  2. 如何加快C++代码的编译速度 转 ccache

    http://www.cnblogs.com/baiyanhuang/archive/2010/01/17/1730717.html   C++代码一直以其运行时的高性能高调面对世人, 但是说起编译速 ...

  3. mysql查询出相同数据出现的次数,统计相同值的数量

    1.可以使用count SELECT count(name='A' OR NULL) FROM table 2.用sum SELECT sum(if( = 'A', 1, 0)) FROM table ...

  4. Cookie中的sessionid与JSONP原理

    一.首先说明一下cookie中的sessionid的作用. 1.cookie只是一些文本内容,多是键值对的形式,是请求头中的一部分 2.http是无连接的 知道这两点,就可以很容易的理解session ...

  5. freckles

    题目描述: In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad's back ...

  6. Spring Boot 常见标签

    @Controller(value=“名字”,descripation="描述",tags="具体" ) @RestController控制器(path=&qu ...

  7. 根据ip获取地理信息

    function getIPLoc_sina($queryIP){    $url = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php?form ...

  8. Matlab_audiowrite_音频生成

    输出音频文件所需函数为 audiowrite .通过例程进行解释: % 生成时间序列 fs = 5000; % [Hz] 信号采样频率 T = 1; % [s] 信号长度 x = 0:1/fs:T; ...

  9. 吴恩达机器学习-octave笔记

    隐藏前缀提示符:PS1('>>') 不显示打印内容:;结尾 字符串:a=’hi’ 屏幕输出:disp(sprint(‘2 decimals:%0.2f’,a)) 生成集合(矩阵):V=1: ...

  10. laravel 解决session保存不了,取不出的问题

    555  上传服务器的时候 storage下的framework 没有上传啊