From f570dd0e7d18971533dfb5cf85eeb753708d628d Mon Sep 17 00:00:00 2001 From: Mark Benvenuto Date: Mon, 29 Jan 2018 15:42:17 -0500 Subject: Revert "SERVER-32750 Introduce SSLConnectionInterface for SSLConnection and refactor" This reverts commit a263ed4f10132b32117c3981cdaec9522e1288a2. --- src/mongo/util/net/sock.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mongo/util/net/sock.cpp') diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp index 5be8daf6554..30e17d83e5f 100644 --- a/src/mongo/util/net/sock.cpp +++ b/src/mongo/util/net/sock.cpp @@ -415,7 +415,14 @@ std::string Socket::getSNIServerName() const { if (!_sslConnection) return ""; - return _sslConnection->getSNIServerName(); + if (!_sslConnection->ssl) + return ""; + + const char* name = SSL_get_servername(_sslConnection->ssl, TLSEXT_NAMETYPE_host_name); + if (!name) + return ""; + + return name; } #endif -- cgit v1.2.1