Comments (1)
消息队列 kafka 使用 go SDK 的 confluent 客户端,通过 sasl_ssl 连接 kafka,想在 docker 中运行,但是验证证书看起来有问题【证书文件用的时 demo/conf 内 ca-cert.pem 文件】。
dockerfile 如下:
FROM golang:1.16 as builder
RUN apt-get install gcc && apt-get install ca-certificates
RUN go env -w GOPROXY="https://goproxy.cn,direct"
WORKDIR /opt/kafka
COPY . .
RUN go mod tidy
RUN go build
ENTRYPOINT ["./kafka"]
日志如下:
init kafka producer, it may take a few seconds to init the connection
init kafka producer success
HTTP server Start :7070
%3|1641796736.273|FAIL|rdkafka#producer-1| [thrd:sasl_ssl://alikafka-pre-cn-8ed2i1tx7001-1.alikafka.aliyuncs.com]: sasl_ssl://alikafka-pre-cn-8ed2i1tx7001-1.alikafka.aliyuncs.com:9093/bootstrap: SSL handshake failed: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed: broker certificate could not be verified, verify that ssl.ca.location is correctly configured or root CA certificates are installed (install ca-certificates package) (after 78ms in state SSL_HANDSHAKE)
%3|1641796737.008|FAIL|rdkafka#producer-1| [thrd:sasl_ssl://alikafka-pre-cn-8ed2i1tx7001-1.alikafka.aliyuncs.com]: sasl_ssl://alikafka-pre-cn-8ed2i1tx7001-1.alikafka.aliyuncs.com:9093/bootstrap: SSL handshake failed: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed: broker certificate could not be verified, verify that ssl.ca.location is correctly configured or root CA certificates are installed (install ca-certificates package) (after 44ms in state SSL_HANDSHAKE, 1 identical error(s) suppressed)
日志提醒两个问题 ssl.ca.location is correctly configured or root CA certificates are installed。 确认证书路径没有问题;
ca-certificates如下:
apt-get install ca-certificates
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20200601~deb10u2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
帮看下还有什么会导致这个错误,谢谢
添加这行代码
kafkaconf.SetKey("enable.ssl.certificate.verification", "false")
在配置里面关闭hostname校验即可
from aliware-kafka-demos.
Related Issues (20)
- 求erlang demo
- node kafka连接后一直报错
- Plz support PHP
- pykafka 生产消息时报UnknownError
- filebeat demo 配置在商业版 kafka 会出错 connection reset by peer HOT 1
- springboot 2.0不兼容 HOT 6
- 关于Spring Cloud Stream Kafka Demo的配置问题 HOT 1
- logstash 配置sasl_mechanism ONS 传输失效
- 没有spring boot demo HOT 1
- php在调用producer发送消息时如何设置不需要等待进程结束 HOT 1
- 在升级或者宕机时,会发生少量消息乱序(某个分区挂掉后把消息 Failover 到其它分区)是怎么实现的? HOT 3
- 为啥没有.net的直接sdk,如果歧视.net就别给我发邮件了 HOT 1
- Go README需要更新了
- confluent-kafka-dotnet 也是兼容阿里云 kafkamq的是吗
- go confluent客户端 跨平台编译报错 HOT 1
- confluent-kafka-go 在1.7.0之后已经支持windows,不能提供个完整demo吗?
- Cpp VPC-SSL demo 一直报SSL错误 HOT 3
- 报错:java: 无法访问java.time.Duration 找不到java.time.Duration的类文件 HOT 1
- kafka-nodejs-demo ssl报错
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aliware-kafka-demos.