Commit 6aa911b4 authored by Mingtao Yang's avatar Mingtao Yang Committed by Facebook GitHub Bot

Fix build failure in SSLContextRegressionTest

Differential Revision: D25759768

fbshipit-source-id: c0d38b25ab74bfce82c3d5e1339bd4ceef98af14
parent bc7d7abf
......@@ -19,12 +19,12 @@
#include <folly/io/async/SSLContext.h>
#include <folly/portability/GTest.h>
using namespace folly;
using namespace folly::test;
/*
* This test is meant to verify that SSLContext correctly sets its minimum
* protocol version and is not blocked by OpenSSL's default config.
*/
namespace folly {
// need OpenSSL version 1.1.1 for the SSL_CTX_get_min_proto_version function
// should reduce this prereq's scope if new tests are added that don't need it
#if FOLLY_OPENSSL_PREREQ(1, 1, 1)
......@@ -43,11 +43,11 @@ class SSLContextRegressionTest : public testing::Test {
public:
void SetUp() override {
TemporaryFile confFile{};
FileUtil::writeStringToFile(StringPiece(kOpenSSLConf), confFile.filename());
writeFile(StringPiece(kOpenSSLConf), confFile.path().c_str());
// simulate the system environment by loading a config file that should
// represent the CentOS 8 configuration
int result = CONF_modules_load_file(confFile.filename(), nullptr, 0);
int result = CONF_modules_load_file(confFile.path().c_str(), nullptr, 0);
ASSERT_EQ(result, 1) << "Failed to load OpenSSL conf from temporary file.";
}
};
......@@ -58,7 +58,4 @@ TEST_F(SSLContextRegressionTest, IsNotAffectedBySystemEnvironment) {
auto ctx = std::make_shared<SSLContext>(SSLContext::SSLVersion::TLSv1);
ASSERT_EQ(SSL_CTX_get_min_proto_version(ctx->getSSLCtx()), TLS1_VERSION);
}
#endif
} // namespace folly
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment