nginx启用tls1.3已多时,这里记录下在caddy中启用tls1.3的过程。

安装依赖:

sudo yum -y install docker
service docker start

下载源码:

cd ~
git clone https://github.com/cloudflare/tls-tris.git
go get github.com/mholt/caddy
go get github.com/caddyserver/builds

编译go,使之支持tls1.3:

cd tls-tris; cp _dev/utils/pre-commit .git/hooks/
sudo make -f _dev/Makefile build-all

编译成功,运行如下命令确认:

GOROOT=”/home/$USER/tls-tris/_dev/GOROOT/linux_amd64/” go version
-> go version go1.11.1 linux/amd64

下载并应用caddy补丁:

cd $GOPATH/src/github.com/mholt/caddy
wget https://www.hnrk.io/md/caddy.patch
patch -p1 < caddy.patch

编译caddy:

cd $GOPATH/src/github.com/mholt/caddy/caddy
GOROOT=”/home/$USER/tls-tris/_dev/GOROOT/linux_amd64/” go run build.go

编译成功的caddy在当前目录下。直接替换原caddy后运行即已支持tls 1.3。


发表评论

电子邮件地址不会被公开。 必填项已用*标注