Encrypted TLS 1.2 connection don’t created between the .net framework 4.7.2 client and ArtemisMQ

During the project’s working proccess I get null in the line: connection = await connectionFactory.CreateAsync(endpoints); without any Exception. Artemis also does not record any errors during the connection attempts.

I need to create connection with ArtemisMQ, that running on the docker container. Connection must by encrypted by the TLS 1.2. All needed certificates must be located only in Artemis.
.Net client shouldn’t get any certificates, because project project is written on Framework 4.7.2 and will be run using Mono on Linux, and Mono has no support of X509 certificates.

Attempt of sending messages to the same ArtemisMQ by simple TCP using this .net library works correctly.

For creating the connection I use “.NET Client for Apache ActiveMQ Artemis” library.

This code of service, that create ConnectionFactory, Endpoints and ect:

    public class AmqMessageBrokerService : IAmqMessageBrokerService
    {
        private readonly IBrokerConfigSection brokerConfigSection;
        private ConnectionFactory connectionFactory;
        private List<Endpoint> endpoints = new List<Endpoint>();
        private ProducerConfiguration producerConfiguration;
        private IConnection connection;
        private IProducer producer;
        private bool isConnected = false;

        public AmqMessageBrokerService(
            IBrokerConfigSection brokerConfigSection)
        {
            this.brokerConfigSection = brokerConfigSection;

            connectionFactory = new ConnectionFactory()
            {
                SSL =
                {
                    ClientCertificates = null,
                    Protocols = SslProtocols.Tls12,
                    CheckCertificateRevocation = false,
                    RemoteCertificateValidationCallback = null,
                    LocalCertificateSelectionCallback = null
                }
            };

            var endpoint = Endpoint.Create(
                host: "localhost",
                port: 61617,
                user: brokerConfigSection.ArtemisMQUserName,
                password: brokerConfigSection.ArtemisMQPassword,
                scheme: Scheme.Amqps,
                path: brokerConfigSection.ArtemisMQConnectionString);

            endpoints.Add(endpoint);

            producerConfiguration = new ProducerConfiguration()
            {
                Address = "MyAdress"
            };
        }

        public async Task StartSendMessagesToAmqAsync(
            ISyslogReadQueueManageService syslogReadQueueManageService,
            CancellationToken ct)
        {
            while (!ct.IsCancellationRequested)
            {
                Thread.Sleep(1000);

                Console.WriteLine("Connecting with ArtemisMq is started...n");

                var timeoutTask = Task.Delay(10000);
                var acceptTask = CreateAmqConnectionAsync();

                await Task.WhenAny(timeoutTask, acceptTask);

                if (!acceptTask.IsCompleted)
                {
                    continue;
                }

                await SendMessageToArtemisAsync(
                    syslogReadQueueManageService,
                    ct);

            }
        }

        private async Task CreateAmqConnectionAsync()
        {
            try
            {
                connection = await connectionFactory.CreateAsync(endpoints);

                producer = await connection.CreateProducerAsync(producerConfiguration);

                isConnected = true;
                Console.WriteLine("Connection with ArtemisMq created suxesfull.n");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Exception during the connecting to ArtemisMq: {ex.Message}n");
                isConnected = false;
            }
        }
    }

It is BrokerConfigSection in App.config file of my project:

    <BrokerConfigSection 
ArtemisMQConnectionString="tcp://0.0.0.0:61617" 
ArtemisMQUserName="admin" 
ArtemisMQPassword="admin" 
ArtemisMQQueueName="ExpiryQueue">
    </BrokerConfigSection>

It is an acceptor’s configuration in broker.xml file of Artemis:

<acceptor name="amqps-acceptor">tcp://0.0.0.0:61617?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,MQTT,OPENWIRE;useEpoll=true;sslEnabled=true;keyStoreAlias=amq1;keyStorePath=file:/certs/keystore.jks;keyStorePassword=11111111;enabledProtocols=TLSv1.2</acceptor>

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật