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

启用证书后测试连接:无法连接远程服务器 #360

Open
sxin0 opened this issue Jul 28, 2022 · 1 comment
Open

启用证书后测试连接:无法连接远程服务器 #360

sxin0 opened this issue Jul 28, 2022 · 1 comment

Comments

@sxin0
Copy link

sxin0 commented Jul 28, 2022

创建CA证书

openssl  genrsa  -out ca.key 4096
openssl req -x509 -new -nodes -key ca.key -subj "/CN=CA" -days 3650 -out ca.crt

用CA证书签发server证书

openssl genrsa -out server.key 2048
openssl req -new -key server.key -subj "/CN=server" -out server.csr
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt -days 3650

用CA证书签发client证书

openssl genrsa -out client.key 2048
openssl req -new -key client.key -subj "/CN=client" -out client.csr
echo extendedKeyUsage=clientAuth > extfile.cnf
openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -set_serial 02  -extfile extfile.cnf -out client.crt -days 3650

gocron 启用证书

enable_tls = true
ca_file = /usr/local/gocron/conf/ca.crt
cert_file = /usr/local/gocron/conf/server.crt
key_file = /usr/local/gocron/conf/server.key

gocron-node 启用证书

gocron-node -enable-tls -ca-file=/usr/local/gocron/conf/ca.crt -cert-file=/usr/local/gocron/conf/client.crt -key-file=/usr/local/gocron/conf/client.key

测试连接

连接失败-无法连接远程服务器
@sxin0
Copy link
Author

sxin0 commented Jul 28, 2022

@ouqiang 这是啥原因呢

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

1 participant