forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssl_integration_test.h
54 lines (41 loc) · 1.5 KB
/
ssl_integration_test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include <memory>
#include <string>
#include "test/integration/http_integration.h"
#include "test/integration/server.h"
#include "test/integration/ssl_utility.h"
#include "test/mocks/secret/mocks.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
using testing::NiceMock;
namespace Envoy {
namespace Ssl {
class SslIntegrationTestBase : public HttpIntegrationTest {
public:
SslIntegrationTestBase(Network::Address::IpVersion ip_version)
: HttpIntegrationTest(Http::CodecClient::Type::HTTP1, ip_version, realTime()) {}
void initialize() override;
void TearDown();
Network::ClientConnectionPtr makeSslConn() { return makeSslClientConnection({}); }
virtual Network::ClientConnectionPtr
makeSslClientConnection(const ClientSslTransportOptions& options);
void checkStats();
protected:
bool server_tlsv1_3_{false};
bool server_rsa_cert_{true};
bool server_ecdsa_cert_{false};
bool client_ecdsa_cert_{false};
// Set this true to debug SSL handshake issues with openssl s_client. The
// verbose trace will be in the logs, openssl must be installed separately.
bool debug_with_s_client_{false};
private:
std::unique_ptr<ContextManager> context_manager_;
};
class SslIntegrationTest : public SslIntegrationTestBase,
public testing::TestWithParam<Network::Address::IpVersion> {
public:
SslIntegrationTest() : SslIntegrationTestBase(GetParam()) {}
void TearDown() override { SslIntegrationTestBase::TearDown(); };
};
} // namespace Ssl
} // namespace Envoy