summaryrefslogtreecommitdiff
path: root/src/mongo/transport
diff options
context:
space:
mode:
authorAndrew Shuvalov <andrew.shuvalov@mongodb.com>2020-11-04 03:47:34 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-05 22:45:59 +0000
commiteb98e34176e5964d883d57e1b9c0cb196ae49c64 (patch)
tree1bf6053a2bd28ec44212762e5809e38292c51b1d /src/mongo/transport
parent181fe6f7b1d0f092e8b7e196671fec2c2f45d671 (diff)
downloadmongo-eb98e34176e5964d883d57e1b9c0cb196ae49c64.tar.gz
SERVER-51811: No-op wiring of transient SSL params in related methods
Diffstat (limited to 'src/mongo/transport')
-rw-r--r--src/mongo/transport/session_asio.h6
-rw-r--r--src/mongo/transport/transport_layer.h2
-rw-r--r--src/mongo/transport/transport_layer_asio.cpp6
-rw-r--r--src/mongo/transport/transport_layer_asio.h4
-rw-r--r--src/mongo/transport/transport_layer_manager.cpp4
-rw-r--r--src/mongo/transport/transport_layer_manager.h2
-rw-r--r--src/mongo/transport/transport_layer_mock.cpp2
-rw-r--r--src/mongo/transport/transport_layer_mock.h2
8 files changed, 14 insertions, 14 deletions
diff --git a/src/mongo/transport/session_asio.h b/src/mongo/transport/session_asio.h
index e0d4a627426..a6864b37189 100644
--- a/src/mongo/transport/session_asio.h
+++ b/src/mongo/transport/session_asio.h
@@ -88,7 +88,7 @@ public:
GenericSocket socket,
bool isIngressSession,
Endpoint endpoint = Endpoint(),
- std::shared_ptr<SSLConnectionContext> overrideSSLContext = nullptr) try
+ std::shared_ptr<const SSLConnectionContext> transientSSLContext = nullptr) try
: _socket(std::move(socket)),
_tl(tl),
_isIngressSession(isIngressSession) {
@@ -113,7 +113,7 @@ public:
_local = HostAndPort(_localAddr.toString(true));
_remote = HostAndPort(_remoteAddr.toString(true));
#ifdef MONGO_CONFIG_SSL
- _sslContext = overrideSSLContext ? overrideSSLContext : *tl->_sslContext;
+ _sslContext = transientSSLContext ? transientSSLContext : *tl->_sslContext;
#endif
} catch (const DBException&) {
throw;
@@ -818,7 +818,7 @@ private:
#ifdef MONGO_CONFIG_SSL
boost::optional<asio::ssl::stream<decltype(_socket)>> _sslSocket;
bool _ranHandshake = false;
- std::shared_ptr<SSLConnectionContext> _sslContext;
+ std::shared_ptr<const SSLConnectionContext> _sslContext;
#endif
TransportLayerASIO* const _tl;
diff --git a/src/mongo/transport/transport_layer.h b/src/mongo/transport/transport_layer.h
index 672f768f889..126b6ec7898 100644
--- a/src/mongo/transport/transport_layer.h
+++ b/src/mongo/transport/transport_layer.h
@@ -95,7 +95,7 @@ public:
ConnectSSLMode sslMode,
const ReactorHandle& reactor,
Milliseconds timeout,
- std::shared_ptr<SSLConnectionContext> sslContextOverride) = 0;
+ std::shared_ptr<const SSLConnectionContext> transientSSLContext) = 0;
/**
* Start the TransportLayer. After this point, the TransportLayer will begin accepting active
diff --git a/src/mongo/transport/transport_layer_asio.cpp b/src/mongo/transport/transport_layer_asio.cpp
index 453b2eb3fc3..0517f8d9af3 100644
--- a/src/mongo/transport/transport_layer_asio.cpp
+++ b/src/mongo/transport/transport_layer_asio.cpp
@@ -569,7 +569,7 @@ Future<SessionHandle> TransportLayerASIO::asyncConnect(
ConnectSSLMode sslMode,
const ReactorHandle& reactor,
Milliseconds timeout,
- std::shared_ptr<SSLConnectionContext> sslContextOverride) {
+ std::shared_ptr<const SSLConnectionContext> transientSSLContext) {
struct AsyncConnectState {
AsyncConnectState(HostAndPort peer,
@@ -662,13 +662,13 @@ Future<SessionHandle> TransportLayerASIO::asyncConnect(
#endif
return connector->socket.async_connect(*connector->resolvedEndpoint, UseFuture{});
})
- .then([this, connector, sslMode, sslContextOverride]() -> Future<void> {
+ .then([this, connector, sslMode, transientSSLContext]() -> Future<void> {
stdx::unique_lock<Latch> lk(connector->mutex);
connector->session = std::make_shared<ASIOSession>(this,
std::move(connector->socket),
false,
*connector->resolvedEndpoint,
- sslContextOverride);
+ transientSSLContext);
connector->session->ensureAsync();
#ifndef MONGO_CONFIG_SSL
diff --git a/src/mongo/transport/transport_layer_asio.h b/src/mongo/transport/transport_layer_asio.h
index 076485a34a3..d710ec1c89e 100644
--- a/src/mongo/transport/transport_layer_asio.h
+++ b/src/mongo/transport/transport_layer_asio.h
@@ -129,7 +129,7 @@ public:
ConnectSSLMode sslMode,
const ReactorHandle& reactor,
Milliseconds timeout,
- std::shared_ptr<SSLConnectionContext> sslContextOverride = nullptr) final;
+ std::shared_ptr<const SSLConnectionContext> transientSSLContext = nullptr) final;
Status setup() final;
@@ -207,7 +207,7 @@ private:
std::shared_ptr<ASIOReactor> _acceptorReactor;
#ifdef MONGO_CONFIG_SSL
- synchronized_value<std::shared_ptr<SSLConnectionContext>> _sslContext;
+ synchronized_value<std::shared_ptr<const SSLConnectionContext>> _sslContext;
#endif
std::vector<std::pair<SockAddr, GenericAcceptor>> _acceptors;
diff --git a/src/mongo/transport/transport_layer_manager.cpp b/src/mongo/transport/transport_layer_manager.cpp
index 641ac5e527f..b291671eb9a 100644
--- a/src/mongo/transport/transport_layer_manager.cpp
+++ b/src/mongo/transport/transport_layer_manager.cpp
@@ -72,8 +72,8 @@ Future<SessionHandle> TransportLayerManager::asyncConnect(
ConnectSSLMode sslMode,
const ReactorHandle& reactor,
Milliseconds timeout,
- std::shared_ptr<SSLConnectionContext> sslContextOverride) {
- return _tls.front()->asyncConnect(peer, sslMode, reactor, timeout, sslContextOverride);
+ std::shared_ptr<const SSLConnectionContext> transientSSLContext) {
+ return _tls.front()->asyncConnect(peer, sslMode, reactor, timeout, transientSSLContext);
}
ReactorHandle TransportLayerManager::getReactor(WhichReactor which) {
diff --git a/src/mongo/transport/transport_layer_manager.h b/src/mongo/transport/transport_layer_manager.h
index d6356621f52..a4fd33cd863 100644
--- a/src/mongo/transport/transport_layer_manager.h
+++ b/src/mongo/transport/transport_layer_manager.h
@@ -71,7 +71,7 @@ public:
ConnectSSLMode sslMode,
const ReactorHandle& reactor,
Milliseconds timeout,
- std::shared_ptr<SSLConnectionContext> sslContextOverride = nullptr) override;
+ std::shared_ptr<const SSLConnectionContext> transientSSLContext = nullptr) override;
Status start() override;
void shutdown() override;
diff --git a/src/mongo/transport/transport_layer_mock.cpp b/src/mongo/transport/transport_layer_mock.cpp
index c17bda62a4c..6fca645649d 100644
--- a/src/mongo/transport/transport_layer_mock.cpp
+++ b/src/mongo/transport/transport_layer_mock.cpp
@@ -72,7 +72,7 @@ Future<SessionHandle> TransportLayerMock::asyncConnect(
ConnectSSLMode sslMode,
const ReactorHandle& reactor,
Milliseconds timeout,
- std::shared_ptr<SSLConnectionContext> sslContextOverride) {
+ std::shared_ptr<const SSLConnectionContext> transientSSLContext) {
MONGO_UNREACHABLE;
}
diff --git a/src/mongo/transport/transport_layer_mock.h b/src/mongo/transport/transport_layer_mock.h
index bf48a5a6cc4..b1e778e1e8c 100644
--- a/src/mongo/transport/transport_layer_mock.h
+++ b/src/mongo/transport/transport_layer_mock.h
@@ -65,7 +65,7 @@ public:
ConnectSSLMode sslMode,
const ReactorHandle& reactor,
Milliseconds timeout,
- std::shared_ptr<SSLConnectionContext> sslContextOverride = nullptr) override;
+ std::shared_ptr<const SSLConnectionContext> transientSSLContext = nullptr) override;
Status setup() override;
Status start() override;