@Override
  public void onConnectionBound(Event event) {
    Transport transport = event.getTransport();
    SslDomain domain = Proton.sslDomain();
    domain.init(Mode.SERVER);

    domain.setPeerAuthentication(SslDomain.VerifyMode.ANONYMOUS_PEER);
    transport.ssl(domain);

    Sasl sasl = transport.sasl();
    sasl.allowSkip(true);
    sasl.setMechanisms("PLAIN");
    // sasl.done(SaslOutcome.PN_SASL_OK);*/
  }
Beispiel #2
0
 void init() throws NetworkException {
   synchronized (_lock) {
     _collector = Collector.Factory.create();
     _transport = Transport.Factory.create();
     _connection = Connection.Factory.create();
     String id = _settings.getId();
     _connection.collect(_collector);
     _connection.setContainer(
         id == null || id.trim().equals("") ? UUID.randomUUID().toString() : id);
     _connection.setHostname(_settings.getHost());
     _transport.bind(_connection);
     Sasl sasl = _transport.sasl();
     sasl.client();
     sasl.setMechanisms(new String[] {"ANONYMOUS"});
     _connection.open();
     _connected.set(true);
     write();
   }
 }