利用letsencrypt和gost搭建https代理

1,703 views
Skip to first unread message

Rain Zen

unread,
Dec 18, 2015, 5:05:34 AM12/18/15
to go-gost
letsencrypt在12月3号正式进行公测了,也就是说现在所有人都可以免费拥有自己的tls证书了,前提是服务器要绑定域名。

首先当然是要生成证书:
$ cd letsencrypt
$ ./letsencrypt-auto certonly --email your_email@email.com -d your_host_domain.com

如果一切顺利的话,在/etc/letsencrypt/下会会生成live目录,进去后会有你的域名目录,再进去就是你的证书了。
我们只用到两个文件cert.pemprivkey.pem

证书生成好了,下面就可以运行https代理了:

gost内置了一个tls证书,如果要使用自己的证书,需要在gost的运行目录中放置cert.pem和key.pem两个文件(key.pem即letsencrypt生成的privkey.pem),

假如gost可执行文件在/home/abc目录下,可以将letsencrypt证书拷贝到此目录:
# cd /home/abc
# cp /etc/letsencrypt/live/your_host_domain.com/cert.pem /home/abc/cert.pem
# cp /etc/letsencrypt/live/your_host_domain.com/privkey.pem /home/abc/key.pem


最后运行gost:
# gost -L=http+tls://:443 -logtostderr -v=2

如果没有报 'open cert.pem: no such file or directory' 错误,则说明letsencrypt的证书加载成功。

浏览器端使用SwitchyOmega添加此https代理就可以使用了。
Message has been deleted

886...@gmail.com

unread,
Apr 1, 2016, 3:30:37 PM4/1/16
to go-gost
是否支持https用户名密码验证呢?还有如何保持在后台运行 感谢!

在 2015年12月18日星期五 UTC+8下午6:05:34,Rain Zen写道:

luxun

unread,
Aug 30, 2016, 11:08:30 PM8/30/16
to go-gost
只有.key和.crt证书怎么办呢?


在 2015年12月18日星期五 UTC+8下午6:05:34,Rain Zen写道:
letsencrypt在12月3号正式进行公测了,也就是说现在所有人都可以免费拥有自己的tls证书了,前提是服务器要绑定域名。

Rain Zen

unread,
Aug 30, 2016, 11:23:02 PM8/30/16
to go-gost
.key对应的就是key.pem,.crt对应的就是cert.pem,改下名字应该就可以了。

在 2016年8月31日星期三 UTC+8上午11:08:30,luxun写道:

luxun

unread,
Aug 31, 2016, 12:17:47 AM8/31/16
to go-gost
谢谢,真的可以了

在 2016年8月31日星期三 UTC+8上午11:23:02,Rain Zen写道:

frank luo

unread,
Apr 18, 2023, 3:53:56 AM4/18/23
to go-gost
no effect
{"handler":"http","kind":"service","level":"error","listener":"tls","msg":"remote error: tls: unknown certificate","service":"service-0","time":"2023-04-18T15:35:35.430+08:00"}
Reply all
Reply to author
Forward
0 new messages