Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何在CDN节点与源站之间开启SSL #11

Closed
vonaxs opened this issue Mar 14, 2022 · 15 comments
Closed

如何在CDN节点与源站之间开启SSL #11

vonaxs opened this issue Mar 14, 2022 · 15 comments

Comments

@vonaxs
Copy link

vonaxs commented Mar 14, 2022

用户与CDN节点可以通过SSL连接。
但如何确保在CDN节点与源站之间开启SSL呢?因为源站没有SSL证书。

是不是可以这样理解:
在“网站服务”—“设置”—“反向代理”—“源站地址”中。
如果源站地址类似http://123.123.123.123:80 这样填写,就没有开启SSL(CDN节点与源站之间通过http连接)。
如果源站地址类似https://123.123.123.123:443 这样填写,就已经开启了SSL(CDN节点与源站之间通过https连接)。
虽然没有证书,但是依然可以通过SSL连接,只要使用https:// 和443端口,就是开启了SSL?

@iwind
Copy link
Contributor

iwind commented Mar 14, 2022

是的,可以这么说,只要使用https协议即可(当前,前提是源站支持)。不过我们后续版本会增加源站的客户端证书上传功能。

@iwind
Copy link
Contributor

iwind commented Mar 14, 2022

更正:现在只要协议选择HTTPS,即可在“更多选项”里选择证书,这适用于那些校验客户端证书的源站。对于其他源站,如果没有选择证书,仍然可以使用HTTPS通讯方式。

@iwind iwind closed this as completed Mar 14, 2022
@vonaxs
Copy link
Author

vonaxs commented Mar 14, 2022

我在“网站服务”—“设置”—“反向代理”—“源站地址”中。
如果我在源站地址中填写域名,即类似http://www.baidu×××.com:80https://www.baidu×××.com:443 (包括上传自己申请的有效SSL证书)。
这样集群节点就会掉线。多次实验得到同样的结果。
好像源站地址只能填写IP而不能填写域名。
这个有解决办法吗

@iwind
Copy link
Contributor

iwind commented Mar 14, 2022

需要看具体的错误提示。

@iwind
Copy link
Contributor

iwind commented Mar 14, 2022

另外,填写域名的时候注意域名是否能够正常解析(在边缘节点上)。

@vonaxs
Copy link
Author

vonaxs commented Mar 15, 2022

1_副本
2

源站地址以IP的方式输入, 一切正常。
源站地址以域名的方式输入 ,节点就掉线。
即使是使用http 和80端口,也会掉线。反复试过了,都是这样。
域名在边缘节点上能够正常解析,因为配置好的最开始几分钟是可以访问源站的,但过几分钟边缘节点就掉线了。
有人填写域名能正常使用吗?
主要是我想如果能填写域名,到时就可以上传自己申请的SSL证书。这样就CDN节点和源站之间就可以使用https连接了。

@iwind
Copy link
Contributor

iwind commented Mar 15, 2022

看一下节点运行日志有没有什么错误信息。或者打开节点的 logs/run.log ,看看有没有错误信息。

@vonaxs
Copy link
Author

vonaxs commented Mar 17, 2022

run.log 并没有发现异常
panic.log 发现异常
如果填写IP,panic.log没有日志,如果填写域名,就会出现这个日志,下面还有日志,太长没有贴出来。

root@vultr:~# cat /root/edge-node/edge-node/logs/panic.log
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x47 pc=0x7f859428a448]

runtime stack:
runtime.throw({0x1fafdf0, 0x7f8595ef05a0})
/usr/local/go/src/runtime/panic.go:1198 +0x71
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:719 +0x396

goroutine 80 [syscall]:
runtime.cgocall(0xcbd2a0, 0xc00128ad90)
/usr/local/go/src/runtime/cgocall.go:156 +0x5c fp=0xc00128ad68 sp=0xc00128ad30 pc=0x40fe5c
net._C2func_getaddrinfo(0xc0013eefc0, 0x0, 0xc001267320, 0xc000250080)
_cgo_gotypes.go:91 +0x56 fp=0xc00128ad90 sp=0xc00128ad68 pc=0x590c56
net.cgoLookupIPCNAME.func1({0xc0013eefc0, 0x0, 0x0}, 0xc000945ea0, 0xc00128ae50)
/usr/local/go/src/net/cgo_unix.go:163 +0x9f fp=0xc00128ade8 sp=0xc00128ad90 pc=0x59299f
net.cgoLookupIPCNAME({0x1f8a94f, 0x3}, {0xc000945ea0, 0x4})
/usr/local/go/src/net/cgo_unix.go:163 +0x16d fp=0xc00128af38 sp=0xc00128ade8 pc=0x5921ed
net.cgoIPLookup(0x35ff7f0, {0x1f8a94f, 0xc0013eefb0}, {0xc000945ea0, 0xc001396a50})
/usr/local/go/src/net/cgo_unix.go:220 +0x3b fp=0xc00128afa8 sp=0xc00128af38 pc=0x592a5b
net.cgoLookupIP·dwrap·25()
/usr/local/go/src/net/cgo_unix.go:230 +0x36 fp=0xc00128afe0 sp=0xc00128afa8 pc=0x592ed6
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc00128afe8 sp=0xc00128afe0 pc=0x474de1
created by net.cgoLookupIP
/usr/local/go/src/net/cgo_unix.go:230 +0x125

‘’‘’‘’‘’‘’‘’‘’‘’

@iwind
Copy link
Contributor

iwind commented Mar 17, 2022

看着是一种跟系统库相关的Bug,相关Bug报告:

可以从这里下载我们最新编译的内测版本:
https://dl.goedge.cn/edge/v0.4.4.4/edge-admin-linux-amd64-plus-v0.4.4.4.zip

看看是否仍然会报错。

@iwind iwind reopened this Mar 17, 2022
@iwind
Copy link
Contributor

iwind commented Mar 17, 2022

我自己在多个环境下测试是没有问题的。应该是跟系统有关系。

@vonaxs
Copy link
Author

vonaxs commented Mar 17, 2022

我的初衷是想确保CDN节点和源站之间也使用https。
如果使用cloudflare的SSL完全(严格)模式,需要保证源站有域名的ssl证书(www.abc.com ),否则无法访问。

我现在是这样弄的。
1.把域名www.abc.com解析到源站,然后在源站申请ssl证书(www.abc.com )并保存下来。
2.在“源站地址”填写源站IP(假设是88.88.88.88),然后上传刚才申请的ssl证书(www.abc.com )。
3.把域名www.abc.com解析到CDN节点(假设是55.55.55.55)。
4.访问域名www.abc.com,成功访问源站。

同时,我测试了一下。
如果修改CDN节点这边上传的ssl证书(www.abc.com ),或者关闭源站的证书(www.abc.com )。
都会导致网站无法访问。

不知道这样操作是不是正确的?
同时,也想请教一下,之前我并没有在步骤2中上传ssl证书(www.abc.com ),但是也可以正常的访问源站。
请问上传证书与否,有什么区别?可否这样理解:
不上传证书对应的是cloudflare的灵活模式?
上传证书对应的是cloudflare的完全(严格)模式?

1
捕获

@iwind
Copy link
Contributor

iwind commented Mar 17, 2022

首先,我需要从你那确认一下现在源站地址使用域名会导致程序退出的问题在新版本中是否还存在。

其次,源站是否必须上传证书跟源站自身的设置有关。

@vonaxs
Copy link
Author

vonaxs commented Mar 17, 2022

首先,我需要从你那确认一下现在源站地址使用域名会导致程序退出的问题在新版本中是否还存在。

其次,源站是否必须上传证书跟源站自身的设置有关。

是 在新版本中还是存在 我的系统是ubuntu18 我试试ubuntu20看看

@iwind
Copy link
Contributor

iwind commented Mar 24, 2022

Hi,现在怎么样了?仍然不可以使用域名吗?如果仍然不可以使用域名,我可以单独编译一个特别版本给你测试。

@iwind iwind closed this as completed Mar 30, 2022
@iwind
Copy link
Contributor

iwind commented Mar 30, 2022

太久没有回应,关闭此issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants