ctx_(ctx),
handshakeTimeout_(this, evb),
connectionTimeout_(this, evb) {
+ noTransparentTls_ = true;
init();
if (server) {
SSL_CTX_set_info_callback(ctx_->getSSLCtx(),
assert(!server_);
assert(state_ == StateEnum::UNINIT);
assert(sslState_ == STATE_UNINIT);
+ noTransparentTls_ = true;
AsyncSSLSocketConnector *connector =
new AsyncSSLSocketConnector(this, callback, timeout);
AsyncSocket::connect(connector, address, timeout, options, bindAddr);
}
int AsyncSocket::socketConnect(const struct sockaddr* saddr, socklen_t len) {
+#if __linux__
+ if (noTransparentTls_) {
+ // Ignore return value, errors are ok
+ setsockopt(fd_, SOL_SOCKET, SO_NO_TRANSPARENT_TLS, nullptr, 0);
+ }
+#endif
int rv = fsp::connect(fd_, saddr, len);
if (rv < 0) {
auto errnoCopy = errno;
* responding and no further progress can be made sending the data.
*/
+#if defined __linux__ && !defined SO_NO_TRANSPARENT_TLS
+#define SO_NO_TRANSPARENT_TLS 200
+#endif
+
#ifdef _MSC_VER
// We do a dynamic_cast on this, in
// AsyncTransportWrapper::getUnderlyingTransport so be safe and
#endif
}
+ void disableTransparentTls() {
+ noTransparentTls_ = true;
+ }
+
enum class StateEnum : uint8_t {
UNINIT,
CONNECTING,
bool tfoEnabled_{false};
bool tfoAttempted_{false};
bool tfoFinished_{false};
+ bool noTransparentTls_{false};
std::unique_ptr<EvbChangeCallback> evbChangeCb_{nullptr};
};