MCPcopy Create free account
hub / github.com/apache/qpid-proton / on_connection_open

Method on_connection_open

cpp/examples/ssl_client_cert.cpp:55–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 proton::listener listener;
54
55 void on_connection_open(proton::connection &c) override {
56 std::cout << "Inbound server connection connected via SSL. Protocol: " <<
57 c.transport().ssl().protocol() << std::endl;
58 if (c.transport().sasl().outcome() == sasl::OK) {
59 std::string subject = c.transport().ssl().remote_subject();
60 std::cout << "Inbound client certificate identity " << find_CN(subject) << std::endl;
61 }
62 else {
63 std::cout << "Inbound client authentication failed" <<std::endl;
64 c.close();
65 }
66 listener.stop();
67
68 // Go and do default inbound open stuff too
69 messaging_handler::on_connection_open(c);
70 }
71
72 void on_message(proton::delivery &, proton::message &m) override {
73 std::cout << m.body() << std::endl;

Callers

nothing calls this directly

Calls 9

protocolMethod · 0.80
find_CNFunction · 0.70
sslMethod · 0.45
transportMethod · 0.45
outcomeMethod · 0.45
saslMethod · 0.45
remote_subjectMethod · 0.45
closeMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected