File tree Expand file tree Collapse file tree 5 files changed +17
-0
lines changed Expand file tree Collapse file tree 5 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ HttpListener::getLocalPort() const {
42
42
return (impl_->getEndpoint ().getPort ());
43
43
}
44
44
45
+ const TlsContextPtr&
46
+ HttpListener::getTlsContext () const {
47
+ return (impl_->getTlsContext ());
48
+ }
49
+
45
50
int
46
51
HttpListener::getNative () const {
47
52
return (impl_->getNative ());
Original file line number Diff line number Diff line change @@ -115,6 +115,9 @@ class HttpListener {
115
115
// / @brief Returns local port on which server is listening.
116
116
uint16_t getLocalPort () const ;
117
117
118
+ // / @brief Returns reference to the current TLS context.
119
+ const asiolink::TlsContextPtr& getTlsContext () const ;
120
+
118
121
// / @brief file descriptor of the underlying acceptor socket.
119
122
int getNative () const ;
120
123
Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ HttpListenerImpl::getEndpoint() const {
70
70
return (*endpoint_);
71
71
}
72
72
73
+ const TlsContextPtr&
74
+ HttpListenerImpl::getTlsContext () const {
75
+ return (tls_context_);
76
+ }
77
+
73
78
int
74
79
HttpListenerImpl::getNative () const {
75
80
return (acceptor_ ? acceptor_->getNative () : -1 );
Original file line number Diff line number Diff line change @@ -60,6 +60,9 @@ class HttpListenerImpl : public boost::enable_shared_from_this<HttpListenerImpl>
60
60
// / @brief Returns reference to the current listener endpoint.
61
61
const asiolink::TCPEndpoint& getEndpoint () const ;
62
62
63
+ // / @brief Returns reference to the current TLS context.
64
+ const asiolink::TlsContextPtr& getTlsContext () const ;
65
+
63
66
// / @brief file descriptor of the underlying acceptor socket.
64
67
int getNative () const ;
65
68
Original file line number Diff line number Diff line change @@ -392,6 +392,7 @@ class BaseListenerTest : public ::testing::Test {
392
392
ASSERT_NO_THROW (listener.start ());
393
393
ASSERT_EQ (SERVER_ADDRESS, listener.getLocalAddress ().toText ());
394
394
ASSERT_EQ (SERVER_PORT, listener.getLocalPort ());
395
+ ASSERT_EQ (server_context_, listener.getTlsContext ());
395
396
ASSERT_NO_THROW (startRequest (request));
396
397
ASSERT_NO_THROW (runIOService ());
397
398
ASSERT_EQ (1 , clients_.size ());
You can’t perform that action at this time.
0 commit comments