Exemplo n.º 1
0
 /// <summary>
 /// Make a test TLS connection to the broker
 /// without using client-certificates
 /// </summary>
 //[Test]
 public void DoSslConnection()
 {
     // because for tests we don't usually trust the server certificate
     // we need here to tell the client to ignore certificate validation errors
     SslOptions sslConfig = new SslOptions(null, true);
     
     MakeBrokerConnection(sslConfig);
 }
Exemplo n.º 2
0
 private static void MakeBrokerConnection(SslOptions options)
 {
     IConnectionInfo connectionInfo = new QpidConnectionInfo();
     connectionInfo.VirtualHost = "test";
     connectionInfo.AddBrokerInfo(new AmqBrokerInfo("amqp", "localhost", 8672, options));
     
     using ( IConnection connection = new AMQConnection(connectionInfo) )
     {
         Console.WriteLine("connection = " + connection);
     }
 }
        public AmqBrokerInfo(string transport, string host, int port, SslOptions sslConfig)
            : this()
        {
            _transport = transport;
            _host      = host;
            _port      = port;

            if (sslConfig != null)
            {
                SetOption(BrokerInfoConstants.OPTIONS_SSL, "true");
                _sslOptions = sslConfig;
            }
        }
        public bool AttemptReconnection(String host, int port, SslOptions sslConfig)
        {
            IBrokerInfo bd = new AmqBrokerInfo("amqp", host, port, sslConfig);

            _failoverPolicy.setBroker(bd);

            try
            {
                MakeBrokerConnection(bd);
                return(true);
            }
            catch (Exception e)
            {
                _log.Debug("Unable to connect to broker at " + bd, e);
                AttemptReconnection();
            }
            return(false);
        }
Exemplo n.º 5
0
        public bool AttemptReconnection(String host, int port, SslOptions sslConfig)
        {
            IBrokerInfo bd = new AmqBrokerInfo("amqp", host, port, sslConfig);

            _failoverPolicy.setBroker(bd);

            try
            {
                MakeBrokerConnection(bd);
                return true;
            }
            catch (Exception e)
            {
                _log.Debug("Unable to connect to broker at " + bd, e);
                AttemptReconnection();
            }
            return false;
        }
Exemplo n.º 6
0
 public AmqBrokerInfo(string transport, string host, int port, SslOptions sslConfig)
    : this()
 {
    _transport = transport;
    _host = host;
    _port = port;
     
    if ( sslConfig != null )
    {
       SetOption(BrokerInfoConstants.OPTIONS_SSL, "true");
       _sslOptions = sslConfig;
    }
 }