예제 #1
0
    void on_container_start(proton::container &c) override {
        // Configure listener.  Details vary by platform.
        ssl_certificate server_cert = platform_certificate("tserver", "tserverpw");
        ssl_server_options ssl_srv(server_cert);
        connection_options server_opts;
        server_opts.ssl_server_options(ssl_srv).handler(&s_handler);
        c.server_connection_options(server_opts);

        // Configure client with a Certificate Authority database populated with the server's self signed certificate.
        // Since the test certifcate's credentials are unlikely to match this host's name, downgrade the verification
        // from VERIFY_PEER_NAME to VERIFY_PEER.
        connection_options client_opts;
        ssl_client_options ssl_cli(platform_CA("tserver"), proton::ssl::VERIFY_PEER);
        client_opts.ssl_client_options(ssl_cli);
        c.client_connection_options(client_opts);

        s_handler.acceptor = c.listen(url);
        c.open_sender(url);
    }
예제 #2
0
    void on_container_start(proton::event &e, proton::container &c) override {
        // Configure listener.  Details vary by platform.
        ssl_certificate server_cert = platform_certificate("tserver", "tserverpw");
        std::string client_CA = platform_CA("tclient");
        // Specify an SSL domain with CA's for client certificate verification.
        ssl_server_options srv_ssl(server_cert, client_CA);
        connection_options server_opts;
        server_opts.ssl_server_options(srv_ssl).handler(&s_handler);
        server_opts.sasl_allowed_mechs("EXTERNAL");
        c.server_connection_options(server_opts);

        // Configure client.
        ssl_certificate client_cert = platform_certificate("tclient", "tclientpw");
        std::string server_CA = platform_CA("tserver");
        // Since the test certifcate's credentials are unlikely to match this host's name, downgrade the verification
        // from VERIFY_PEER_NAME to VERIFY_PEER.
        ssl_client_options ssl_cli(client_cert, server_CA, proton::ssl::VERIFY_PEER);
        connection_options client_opts;
        client_opts.ssl_client_options(ssl_cli).sasl_allowed_mechs("EXTERNAL");
        c.client_connection_options(client_opts);

        s_handler.inbound_listener = c.listen(url);
        c.open_sender(url);
    }
 sender(proton::container& cont, const std::string& url, const std::string& address)
     : work_queue_(0), queued_(0), credit_(0)
 {
     cont.open_sender(url+"/"+address, proton::connection_options().handler(*this));
 }
예제 #4
0
 void on_container_start(proton::event &e, proton::container &c) override {
     sender = c.open_sender(url);
     // Create a receiver with a dynamically chosen unique address.
     receiver = sender.connection().open_receiver("", proton::link_options().dynamic_address(true));
 }
예제 #5
0
 void on_container_start(proton::container &c) override {
     c.receiver_options(proton::receiver_options().credit_window(1024));
     c.open_sender(url_);
 }