31 if (
socketpair(PF_LOCAL, SOCK_STREAM, 0, fds) != 0) {
32 LOG(ERROR) <<
"failed to create socketpair: " <<
errnoStr(errno);
34 for (
int idx = 0; idx < 2; ++idx) {
35 int flags = fcntl(fds[idx], F_GETFL, 0);
37 LOG(ERROR) <<
"failed to get flags for socket " << idx <<
": " 40 if (fcntl(fds[idx], F_SETFL, flags | O_NONBLOCK) != 0) {
41 LOG(ERROR) <<
"failed to put socket " << idx
42 <<
" in non-blocking mode: " <<
errnoStr(errno);
48 std::shared_ptr<folly::SSLContext> clientCtx,
49 std::shared_ptr<folly::SSLContext> serverCtx) {
50 clientCtx->ciphers(
"ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
52 serverCtx->ciphers(
"ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
63 serverName =
"xyz.newdev.facebook.com";
64 getctx(clientCtx, dfServerCtx);
85 std::unique_ptr<SSLSession> sess;
92 auto clientPtr = clientSock.get();
102 sess = std::make_unique<SSLSession>(clientPtr->getSSLSession());
111 auto clientPtr = clientSock.get();
132 auto clientPtr = clientSock.get();
142 std::unique_ptr<SSLSession> sess =
143 std::make_unique<SSLSession>(clientPtr->getSSLSession());
153 auto clientPtr = clientSock.get();
154 std::unique_ptr<SSLSession> sess =
155 std::make_unique<SSLSession>(sessiondata);
175 auto clientPtr = clientSock.get();
185 std::unique_ptr<SSLSession> sess =
186 std::make_unique<SSLSession>(clientPtr->getSSLSession());
#define ASSERT_GE(val1, val2)
const std::string kTestKey
constexpr detail::Map< Move > move
std::shared_ptr< SSLContext > hskServerCtx
—— Concurrent Priority Queue Implementation ——
std::shared_ptr< SSLContext > dfServerCtx
std::unique_ptr< AsyncSSLSocket, Destructor > UniquePtr
std::string getSessionID() const
SSL_SESSION * getRawSSLSessionDangerous()
fbstring errnoStr(int err)
TEST_F(SSLSessionTest, GetSessionID)
std::string serialize() const
void getctx(std::shared_ptr< folly::SSLContext > clientCtx, std::shared_ptr< folly::SSLContext > serverCtx)
folly::EventBase eventBase
#define ASSERT_NE(val1, val2)
#define ASSERT_TRUE(condition)
int socketpair(int domain, int type, int protocol, NetworkSocket sv[2])
std::shared_ptr< SSLContext > clientCtx