【发布时间】:2021-08-10 17:18:31
【问题描述】:
我正在 docker 内部从 https://github.com/buchgr/bazel-remote 运行 Bazel 远程缓存,通过运行以下命令来启动 http 和 grpc 服务器:
docker pull buchgr/bazel-remote-cache
docker run -u 1000:1000 -v /path/to/cache/dir:/data -p 9093:8080 -p 9094:9092 buchgr/bazel-remote-cache
到目前为止,我可以通过运行以下命令之一从客户端运行一些测试:
bazelisk test --remote_cache=http://<SERVER_IP>:<SERVER_PORT> <TEST_TARGET>
bazelisk test --remote_cache=grpc://<SERVER_IP>:<SERVER_PORT> <TEST_TARGET>
但是当我通过向服务器调用添加以下标志来让我的服务器在 TLS 上运行时:
-v /path/to/certificate_authority:/etc/bazel-remote/ca_cert
-v /path/to/server_cert:/etc/bazel-remote/server_cert
-v /path/to/server_key:/etc/bazel-remote/server_key
--tls_ca_file=/etc/bazel-remote/ca_cert
--tls_cert_file=/etc/bazel-remote/server_cert
--tls_key_file=/etc/bazel-remote/server_key
虽然我创建了一个根 CA 证书来签署我的 服务器 和 客户端 证书,但我无法访问我的服务器通过 https 或 grpcs。 https 出现以下错误:
avax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
grpcs 如下:
javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
java.security.cert.CertificateException: No subject alternative names present
ERROR: Failed to query remote execution capabilities: General OpenSslEngine problem
这个问题是否与根 CA 证书本身是自签名的事实有关,还是我在做其他愚蠢的事情?
我使用了以下链接中的相同命令:https://github.com/bazelbuild/bazel/blob/master/src/test/testdata/test_tls_certificate/README.md
【问题讨论】:
-
你能添加你用来生成根CA和客户端+服务器密钥+证书的命令吗?另外,对问题的疯狂猜测:您的 tls_cert_file 仅具有叶证书,没有形成链所必需的中间证书。
-
当然。我使用了与我将添加到帖子中的以下链接中相同的命令:github.com/bazelbuild/bazel/blob/master/src/test/testdata/…