Skip to content

Commit f4c8a47

Browse files
committed
Merge branch fix-https-linux into development
2 parents 1c4171b + fde3e9a commit f4c8a47

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Release/include/cpprest/details/http_server_asio.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class connection
7272
bool m_chunked;
7373
std::atomic<int> m_refs; // track how many threads are still referring to this
7474

75+
std::unique_ptr<boost::asio::ssl::context> m_ssl_context;
7576
std::unique_ptr<boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>> m_ssl_stream;
7677

7778
public:
@@ -85,9 +86,11 @@ class connection
8586
{
8687
if (is_https)
8788
{
88-
boost::asio::ssl::context ssl_context(boost::asio::ssl::context::sslv23);
89-
ssl_context_callback(ssl_context);
90-
m_ssl_stream = utility::details::make_unique<boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>(*m_socket, ssl_context);
89+
m_ssl_context = utility::details::make_unique<boost::asio::ssl::context>(boost::asio::ssl::context::sslv23);
90+
ssl_context_callback(*m_ssl_context);
91+
m_ssl_stream = utility::details::make_unique<boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>(*m_socket, *m_ssl_context);
92+
m_ssl_stream = utility::details::make_unique<boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>(*m_socket, *m_ssl_context);
93+
9194
m_ssl_stream->async_handshake(boost::asio::ssl::stream_base::server, [this](const boost::system::error_code&) { this->start_request_response(); });
9295
}
9396
else

Release/tests/functional/http/client/outside_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ TEST(server_selfsigned_cert)
140140
});
141141
}
142142

143-
TEST(server_hostname_mismatch)
143+
TEST(server_hostname_mismatch, "Ignore", "Site fixed certificate. Improve test (new site or alternate method).")
144144
{
145145
handle_timeout([]
146146
{

Release/tests/functional/websockets/client/authentication_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ TEST(self_signed_cert)
234234
handshake_error_test_impl(U("wss://www.pcwebshop.co.uk/"));
235235
}
236236

237-
TEST(hostname_mismatch)
237+
TEST(hostname_mismatch, "Ignore", "Site fixed certificate. Improve test (new site or alternate method).")
238238
{
239239
handshake_error_test_impl(U("wss://swordsoftruth.com/"));
240240
}

0 commit comments

Comments
 (0)