Skip to content

Commit 2cf1c38

Browse files
shinrichGitHub Enterprise
authored andcommitted
Merge pull request apache#39 from wenli/SSL
add getSslConnection in atscppapi
2 parents 9e83bd0 + 3bcb8c1 commit 2cf1c38

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

lib/cppapi/InterceptPlugin.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,17 @@ InterceptPlugin::getRequestHeaders()
192192
return state_->request_headers_;
193193
}
194194

195+
TSSslConnection
196+
InterceptPlugin::getSslConnection()
197+
{
198+
if (!state_->net_vc_) {
199+
LOG_ERROR("Intercept Plugin is not ready to provide SSL Connection");
200+
return nullptr;
201+
}
202+
203+
return TSVConnSSLConnectionGet(state_->net_vc_);
204+
}
205+
195206
bool
196207
InterceptPlugin::doRead()
197208
{

lib/cppapi/include/atscppapi/InterceptPlugin.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ class InterceptPlugin : public TransactionPlugin
7070
/** Should be called only after request header has completely been consumed */
7171
Headers &getRequestHeaders();
7272

73+
/**
74+
* The returned TSSslConnection would be nullptr if the connection is not a TLS connection
75+
* or Intercept plugin is not ready.
76+
*/
77+
TSSslConnection getSslConnection();
78+
7379
virtual ~InterceptPlugin();
7480

7581
struct State; /** Internal use only */

0 commit comments

Comments
 (0)