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

关于TLS证书和私钥生成疑问 #357

Open
bolin-p opened this issue Jun 30, 2022 · 1 comment
Open

关于TLS证书和私钥生成疑问 #357

bolin-p opened this issue Jun 30, 2022 · 1 comment

Comments

@bolin-p
Copy link

bolin-p commented Jun 30, 2022

image
bin/certstrap-dev-760fa791-linux-amd64 request-cert --ip 127.0.0.1报错
Must provide Common Name, domain, or URI

后续加上--common-name可正常生成,但是无法通过验证正常连接节点端
bin/certstrap-dev-760fa791-linux-amd64 request-cert --ip 127.0.0.1 --common-name "127.0.0.1"

如果只是服务端和客户端同一台服务器上并限制启动服务端127.0.0.1情况下 生成服务端证书和私钥也变成使用127.0.0.1.这种情况下又是如何区分呢?还是说做了127.0.0.1限制就没必要开启tls了???

@Asherlate
Copy link

Asherlate commented Sep 27, 2022

单节点的话确实没必要开启tls

certstrap(v1.3.0) 跟目前 gocron wiki 里面的版本不太一样,如果想要开启tls, 你可以试试以下命令生成证书

#!/bin/bash

#cron-node ips,多个用逗号隔开
IPS="xx.xxx.xx.xx,xx.xxx.xx.xx,xx.xxx.xx.xx,xx.xxx.xx.xx"
#cron ip
HOST="xx.xxx.xx.xx"

COMMON_NAME="随便写"
# 20年有效期
TIME_OUT=20

./certstrap init --common-name "${COMMON_NAME}"
./certstrap request-cert --cn server --ip ${IPS}
./certstrap sign server --CA "${COMMON_NAME}" --years ${TIME_OUT}
./certstrap request-cert --cn client --ip ${HOST}
./certstrap sign client --CA "${COMMON_NAME}" --years ${TIME_OUT}

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