Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/iocore/net/TLSBasicSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class TLSBasicSupport
static void unbind(SSL *ssl);

TLSHandle get_tls_handle() const;
int get_tls_version() const;
const char *get_tls_protocol_name() const;
const char *get_tls_cipher_suite() const;
const char *get_tls_curve() const;
Expand Down
1 change: 0 additions & 1 deletion include/proxy/http/Http1ClientSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class Http1ClientSession : public ProxySession
void do_io_close(int lerrno = -1) override;

// Accessor Methods
bool allow_half_open() const;
void set_half_close_flag(bool flag) override;
bool get_half_close_flag() const override;
int get_transact_count() const override;
Expand Down
1 change: 0 additions & 1 deletion include/proxy/http/Http1ClientTransaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class Http1ClientTransaction : public Http1Transaction
// Methods
void release() override;

bool allow_half_open() const override;
void transaction_done() override;
void increment_transactions_stat() override;
void decrement_transactions_stat() override;
Expand Down
11 changes: 11 additions & 0 deletions src/iocore/net/TLSBasicSupport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ TLSBasicSupport::get_tls_handle() const
return this->_get_ssl_object();
}

int
TLSBasicSupport::get_tls_version() const
{
auto ssl = this->_get_ssl_object();
if (ssl) {
return SSL_version(ssl);
} else {
return 0;
}
}

const char *
TLSBasicSupport::get_tls_protocol_name() const
{
Expand Down
13 changes: 13 additions & 0 deletions src/proxy/ProxyTransaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,19 @@ ProxyTransaction::set_expect_receive_trailer()
bool
ProxyTransaction::allow_half_open() const
{
bool config_allows_it = (_sm) ? _sm->t_state.txn_conf->allow_half_open > 0 : true;
if (config_allows_it) {
// Check with the session to make sure the underlying transport allows the half open scenario
if (auto vc = this->get_netvc(); vc != nullptr) {
if (auto tbs = vc->get_service<TLSBasicSupport>(); tbs != nullptr) {
if (tbs->get_tls_version() == TLS1_3_VERSION) {
return true;
}
} else {
return true;
}
}
}
return false;
}

Expand Down
7 changes: 0 additions & 7 deletions src/proxy/http/Http1ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -540,13 +540,6 @@ Http1ClientSession::start()
this->release(&trans);
}

bool
Http1ClientSession::allow_half_open() const
{
// Only allow half open connections if the not over TLS
return (_vc && _vc->get_service<TLSBasicSupport>() == nullptr);
}

void
Http1ClientSession::set_half_close_flag(bool flag)
{
Expand Down
11 changes: 0 additions & 11 deletions src/proxy/http/Http1ClientTransaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ Http1ClientTransaction::transaction_done()
}
}

bool
Http1ClientTransaction::allow_half_open() const
{
bool config_allows_it = (_sm) ? _sm->t_state.txn_conf->allow_half_open > 0 : true;
if (config_allows_it) {
// Check with the session to make sure the underlying transport allows the half open scenario
return static_cast<Http1ClientSession *>(_proxy_ssn)->allow_half_open();
}
return false;
}

void
Http1ClientTransaction::increment_transactions_stat()
{
Expand Down