无法使用汇合.net客户端连接到azure事件中心

k5hmc34c  于 2021-06-04  发布在  Kafka
关注(0)|答案(0)|浏览(329)

我正在尝试使用confluent.net客户端(1.5.2)连接到azure事件中心,但不断收到ssl握手失败错误。
我的confluent producerconfig如下所示:

var config = new ProducerConfig
{
    BootstrapServers = "ehNamespace.servicebus.windows.net:9093",
    SecurityProtocol = SecurityProtocol.SaslSsl,
    SaslMechanism = SaslMechanism.Plain,
    SaslUsername = "$ConnectionString",
    SaslPassword = "Endpoint=sb://ehNamespace.servicebus.windows.net/;SharedAccessKeyName=accessKeyName;SharedAccessKey=accessKey;EntityPath=eventHubName",
    SslCaLocation = "cacert.pem",
    Debug = "security,broker,protocol"
};

当我构建producerclient时,它无法连接ssl握手失败:

%7|1607458909.957|SASL|rdkafka#producer-1| [thrd:app]: Selected provider PLAIN (builtin) for SASL mechanism PLAIN
%7|1607458909.958|OPENSSL|rdkafka#producer-1| [thrd:app]: librdkafka built with OpenSSL version 0x1000211f
%7|1607458910.231|SSL|rdkafka#producer-1| [thrd:app]: Loading CA certificate(s) from file cacert.pem
%7|1607458910.241|BRKMAIN|rdkafka#producer-1| [thrd::0/internal]: :0/internal: Enter main broker thread
%7|1607458910.241|BROKER|rdkafka#producer-1| [thrd:app]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: Added new broker with NodeId -1
%7|1607458910.242|CONNECT|rdkafka#producer-1| [thrd:app]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: Selected for cluster connection: bootstrap servers added (broker has 0 connection attempt(s))
%7|1607458910.242|BRKMAIN|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: Enter main broker thread
%7|1607458910.242|INIT|rdkafka#producer-1| [thrd:app]: librdkafka v1.5.2 (0x10502ff) rdkafka#producer-1 initialized (builtin.features gzip,snappy,ssl,sasl,regex,lz4,sasl_gssapi,sasl_plain,sasl_scram,plugins,zstd,sasl_oauthbearer, SSL ZLIB SNAPPY SASL_SCRAM PLUGINS HDRHISTOGRAM, debug 0x282)
%7|1607458910.242|CONNECT|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: Received CONNECT op
%7|1607458910.243|STATE|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: Broker changed state INIT -> TRY_CONNECT
%7|1607458910.243|CONNECT|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: broker in state TRY_CONNECT connecting
%7|1607458910.243|STATE|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: Broker changed state TRY_CONNECT -> CONNECT
%7|1607458910.273|CONNECT|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: Connecting to ipv4#40.71.10.149:9093 (sasl_ssl) with socket 1168
%7|1607458910.297|CONNECT|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: Connected to ipv4#40.71.10.149:9093
%7|1607458910.327|FAIL|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: SSL handshake failed: SSL transport error: Unknown error (after 84ms in state CONNECT) (_SSL)
%3|1607458910.327|FAIL|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: SSL handshake failed: SSL transport error: Unknown error (after 84ms in state CONNECT)
%7|1607458910.329|STATE|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap: Broker changed state CONNECT -> DOWN
%3|1607458910.330|ERROR|rdkafka#producer-1| [thrd:sasl_ssl://ehNamespace.servicebus.windows.net:9093/bootstrap]: 1/1 brokers are down

我尝试了两个不同的活动中心没有运气。有人能帮我理解为什么这是失败的,我能做什么让它工作?
谢谢!

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题