30 void verifySSLCipherList(
const vector<string>& ciphers);
33 void SSLContextTest::verifySSLCipherList(
const vector<string>& ciphers) {
36 for (
auto&
cipher : ciphers) {
39 ASSERT_EQ(
nullptr, SSL_get_cipher_list(ssl.get(),
i));
43 ctx.ciphers(
"AES128-SHA:ECDHE-RSA-AES256-SHA384");
44 verifySSLCipherList({
"AES128-SHA",
"ECDHE-RSA-AES256-SHA384"});
48 const vector<string> ciphers = {
"ECDHE-RSA-AES128-SHA",
"AES256-SHA"};
49 ctx.setCipherList(ciphers);
50 verifySSLCipherList(ciphers);
55 const char* certPath =
"folly/io/async/test/certs/tests-cert.pem";
56 const char* keyPath =
"folly/io/async/test/certs/tests-key.pem";
57 const char* anotherKeyPath =
"folly/io/async/test/certs/client_key.pem";
79 SCOPED_TRACE(
"Invalid cert/key pair from file. Load cert first");
86 SCOPED_TRACE(
"Invalid cert/key pair from file. Load key first");
94 SCOPED_TRACE(
"Invalid key/cert pair from buf. Load cert first");
102 SCOPED_TRACE(
"Invalid key/cert pair from buf. Load key first");
111 "loadCertKeyPairFromBufferPEM() must throw when cert/key mismatch");
120 "loadCertKeyPairFromBufferPEM() must succeed when cert/key match");
127 "loadCertKeyPairFromFiles() must throw when cert/key mismatch");
135 SCOPED_TRACE(
"loadCertKeyPairFromFiles() must succeed when cert/key match");
virtual void loadCertificateFromBufferPEM(folly::StringPiece cert)
virtual void loadCertKeyPairFromBufferPEM(folly::StringPiece cert, folly::StringPiece pkey)
#define ASSERT_STREQ(s1, s2)
bool readFile(int fd, Container &out, size_t num_bytes=std::numeric_limits< size_t >::max())
#define EXPECT_THROW(statement, expected_exception)
#define ASSERT_EQ(val1, val2)
virtual bool isCertKeyPairValid() const
#define SCOPED_TRACE(message)
—— Concurrent Priority Queue Implementation ——
virtual void loadCertKeyPairFromFiles(const char *certPath, const char *keyPath, const char *certFormat="PEM", const char *keyFormat="PEM")
virtual void loadPrivateKeyFromBufferPEM(folly::StringPiece pkey)
virtual void loadPrivateKey(const char *path, const char *format="PEM")
virtual void loadCertificate(const char *path, const char *format="PEM")
#define EXPECT_TRUE(condition)
#define EXPECT_FALSE(condition)
std::unique_ptr< SSL, SSLDeleter > SSLUniquePtr
TEST_F(SSLContextTest, TestLoadCertKey)