【发布时间】:2015-07-27 12:58:40
【问题描述】:
我在 c# 中使用 mqtt 库并遵循此 url。 http://www.embedded101.com/Blogs/PaoloPatierno/entryid/366/mqtt-over-ssl-tls-with-the-m2mqtt-library-and-the-mosquitto-broker 通过在我将客户端连接到本地主机服务器时实现此 url 发生以下错误:-
C:\Program Files\mosquitto>mosquitto -c mosquitto.conf -v
1438001198: mosquitto version 1.4 (build date 27/02/2015 21:01:03.50) starting
1438001198: Config loaded from mosquitto.conf.
1438001198: Opening ipv4 listen socket on port 8883.
Enter PEM pass phrase:
1438001224: New connection from 10.112.154.82 on port 8883.
1438001224: OpenSSL Error: error:140890C7:SSL routines:ssl3_get_client_certifica
te:peer did not return a certificate
1438001224: Socket error on client <unknown>, disconnecting.
我的代码是:-
X509Certificate certificate = new X509Certificate(@"D:\POC\Abhinav\cert\cert\m2mqtt_ca.crt", "india@123");
MqttClient client = new MqttClient("10.112.154.82", 8883, true, new X509Certificate(certificate));
string clientId = new Guid("b0ca37b1-8a90-4a59-9665-fd8504357165").ToString();
client.Connect(clientId);
错误:
c# Error:-{"A call to SSPI failed, see inner exception."}
谁能建议我如何使用 mosquitto 在 mqtt 中实现证书。
【问题讨论】:
-
内部异常是什么?
-
控制台错误:- C:\Program Files\mosquitto>mosquitto -c mosquitto.conf -v 1438076057:mosquitto 版本 1.4(构建日期 27/02/2015 21:01:03.50)从 1438076057 开始:从 mosquitto.conf 加载的配置。 1438076057:在端口 8883 上打开 ipv4 侦听套接字。输入 PEM 密码:1438076075:在端口 8883 上从 10.112.154.82 建立新连接。1438076093:客户端
上的套接字错误,正在断开连接。 -
C#中:--{"根据验证程序,远程证书无效。"}