首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在docker redhat/kafka-connect容器中安装cosmos db模拟器SSL证书

在docker redhat/kafka-connect容器中安装cosmos db模拟器SSL证书
EN

Stack Overflow用户
提问于 2022-05-20 10:49:10
回答 1查看 526关注 0票数 0

我在本地机器上设置了Cosmos DB仿真器,并从以下参数开始:

代码语言:javascript
运行
复制
/port=443 /AllowNetworkAccess /Key=<CosmosPrimaryKey>

目前,它可以通过https://<LocalMachineIP>/访问。

当我试图从docker Redhat容器(使用docker映像:confluentinc/cp connect)发出卷曲请求时,它将引发以下错误:

代码语言:javascript
运行
复制
curl: (60) SSL certificate problem: self signed certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

并且,当试图引导cosmos DB源连接器时,它会抛出以下错误:

代码语言:javascript
运行
复制
   [20 10:37:45,018] ERROR Client initialization failed. Check if the endpoint is reachable and if your auth token is valid. More info: https://aka.ms/cosmosdb-tsg-service-unavailable-java (com.azure.cosmos.implementation.RxDocumentClientImpl)
    
    [2022-05-20 10:37:45,079] ERROR unexpected failure in initializing client. (com.azure.cosmos.implementation.RxDocumentClientImpl)
    
    java.lang.RuntimeException: Client initialization failed. Check if the endpoint is reachable and if your auth token is valid. More info: https://aka.ms/cosmosdb-tsg-service-unavailable-java
    
    at com.azure.cosmos.implementation.RxDocumentClientImpl.initializeGatewayConfigurationReader(RxDocumentClientImpl.java:401)
    
    .......
    
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    
    at java.base/java.lang.Thread.run(Thread.java:829)
    
    [2022-05-20 10:37:45,095] WARN [8e2a220b, L:/172.25.0.6:57076 ! R:/192.168.154.131:443] The connection observed an error (reactor.netty.http.client.HttpClientConnect)
    
    shaded.io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    
    at shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:477)
    
    ..........
    
    at shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
    
    at shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    
    at shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    
    at java.base/java.lang.Thread.run(Thread.java:829)
    
    Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    
    at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
    
   .........
    at shaded.io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1283)
    
    at shaded.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507)
    
    at shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:446)
    
    ... 17 more
    
    Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    
    at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439)
    
   .....................
    
    at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1335)
    
    ... 31 more
    
    Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    
    at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
    
    at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
    
    at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
    
    at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)
    
    ... 37 more

我已经使用.cer导出了cosmos仿真器这篇文章文件。

如何将其安装在码头集装箱"kafka-connect“中?

EN

回答 1

Stack Overflow用户

发布于 2022-06-03 21:56:55

你能发你的卷发请求吗?您需要使用-k标志来表示它是不安全的。

代码语言:javascript
运行
复制
curl -k https://{emulatoripaddr}:8081/_explorer/emulator.pem > emulatorcert.crt

它需要是.crt,然后复制到

代码语言:javascript
运行
复制
/usr/local/share/ca-certificates/

然后安装它

代码语言:javascript
运行
复制
update-ca-certificates

此外,您还可以将卷挂载到cosmos文件夹并手动保存.pem…。/tmp/cosmos/appdata

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72317663

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档