CSGHub
CSGHub copied to clipboard
修改为https后,登录git报错
{"time":"2024-08-07T02:44:24.535775152Z","level":"ERROR","msg":"Error sending request:","!BADKEY":"Post "https://192.168.73.2:6081/gitserver/api/v1/users/root/tokens": tls: failed to verify certificate: x509: cannot validate certificate for 192.168.73.2 because it doesn't contain any IP SANs"}
如果 gitserver使用http的接口,没有找到错误日志,但admin001的用户无法成功创建到git中
发现根本原因是: /app/services/starhub/client.rb中 发送https请求报错,是否可以添加忽略安全认证的配置
@hiveer 可以考虑在 rails 端添加一个配置,来决定是否忽略 ssl 证书认证
uri = URI('https://example.com')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri)
response = http.request(request)