小编Alb*_*ert的帖子

带有.NET Core 2.0的AmazonMQ

有没有人设法通过SSL使用.NET Core 2.0连接到AmazonMQ?

我使用Apache.NMS.ActiveMQ.Core包连接时出现以下错误:

System.NotSupportedException: The requested security protocol is not supported.
   at System.Net.SecurityProtocol.ThrowOnNotAllowed(SslProtocols protocols, Boolean allowNone)
   at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
   at Apache.NMS.ActiveMQ.Transport.Tcp.SslTransport.CreateSocketStream()
   at Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransport.Start()
   at Apache.NMS.ActiveMQ.Transport.WireFormatNegotiator.Start()
   at Apache.NMS.ActiveMQ.Connection.CheckConnected()
   at Apache.NMS.ActiveMQ.Connection.CreateActiveMQSession(AcknowledgementMode ackMode)
   at SendToMQ.Program.SendMessage() in C:\GITLab\POC\SendToMQ\SendToMQ\SendToMQ\Program.cs:line 40
   at SendToMQ.Program.Main(String[] args) in C:\GITLab\POC\SendToMQ\SendToMQ\SendToMQ\Program.cs:line 15
Run Code Online (Sandbox Code Playgroud)

使用以下代码:

string url = "ssl://url:61617";
string userName = "name";
string password = "pw";


string payLoad = "This is a test.";
IConnectionFactory factory = new ConnectionFactory(new Uri(url));

using (IConnection connection = factory.CreateConnection(userName, password)) …
Run Code Online (Sandbox Code Playgroud)

activemq-classic .net-core amazon-mq

3
推荐指数
1
解决办法
1188
查看次数

标签 统计

.net-core ×1

activemq-classic ×1

amazon-mq ×1