|
|
@ -277,34 +277,18 @@ TEST(CredentialsTest, MultipleServerCredentialsOneCrlProviderDoesNotLeak) { |
|
|
|
EXPECT_NE(server_creds_2, nullptr); |
|
|
|
EXPECT_NE(server_creds_2, nullptr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TEST( |
|
|
|
TEST(CredentialsTest, TlsServerCredentialsWithGoodMinMaxTlsVersions) { |
|
|
|
CredentialsTest, |
|
|
|
grpc::experimental::TlsServerCredentialsOptions options( |
|
|
|
TlsChannelCredentialsWithStaticDataCertificateProviderAndGoodMinMaxTlsVersions) { |
|
|
|
/*certificate_provider=*/nullptr); |
|
|
|
experimental::IdentityKeyCertPair key_cert_pair; |
|
|
|
|
|
|
|
key_cert_pair.private_key = kIdentityCertPrivateKey; |
|
|
|
|
|
|
|
key_cert_pair.certificate_chain = kIdentityCertContents; |
|
|
|
|
|
|
|
std::vector<experimental::IdentityKeyCertPair> identity_key_cert_pairs; |
|
|
|
|
|
|
|
identity_key_cert_pairs.emplace_back(key_cert_pair); |
|
|
|
|
|
|
|
auto certificate_provider = std::make_shared<StaticDataCertificateProvider>( |
|
|
|
|
|
|
|
kRootCertContents, identity_key_cert_pairs); |
|
|
|
|
|
|
|
grpc::experimental::TlsServerCredentialsOptions options(certificate_provider); |
|
|
|
|
|
|
|
options.set_min_tls_version(grpc_tls_version::TLS1_2); |
|
|
|
options.set_min_tls_version(grpc_tls_version::TLS1_2); |
|
|
|
options.set_max_tls_version(grpc_tls_version::TLS1_3); |
|
|
|
options.set_max_tls_version(grpc_tls_version::TLS1_3); |
|
|
|
auto server_credentials = grpc::experimental::TlsServerCredentials(options); |
|
|
|
auto server_credentials = grpc::experimental::TlsServerCredentials(options); |
|
|
|
EXPECT_NE(server_credentials, nullptr); |
|
|
|
EXPECT_NE(server_credentials, nullptr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TEST( |
|
|
|
TEST(CredentialsTest, TlsServerCredentialsWithBadMinMaxTlsVersions) { |
|
|
|
CredentialsTest, |
|
|
|
grpc::experimental::TlsServerCredentialsOptions options( |
|
|
|
TlsChannelCredentialsWithStaticDataCertificateProviderAndBadMinMaxTlsVersions) { |
|
|
|
/*certificate_provider=*/nullptr); |
|
|
|
experimental::IdentityKeyCertPair key_cert_pair; |
|
|
|
|
|
|
|
key_cert_pair.private_key = kIdentityCertPrivateKey; |
|
|
|
|
|
|
|
key_cert_pair.certificate_chain = kIdentityCertContents; |
|
|
|
|
|
|
|
std::vector<experimental::IdentityKeyCertPair> identity_key_cert_pairs; |
|
|
|
|
|
|
|
identity_key_cert_pairs.emplace_back(key_cert_pair); |
|
|
|
|
|
|
|
auto certificate_provider = std::make_shared<StaticDataCertificateProvider>( |
|
|
|
|
|
|
|
kRootCertContents, identity_key_cert_pairs); |
|
|
|
|
|
|
|
grpc::experimental::TlsServerCredentialsOptions options(certificate_provider); |
|
|
|
|
|
|
|
options.set_min_tls_version(grpc_tls_version::TLS1_3); |
|
|
|
options.set_min_tls_version(grpc_tls_version::TLS1_3); |
|
|
|
options.set_max_tls_version(grpc_tls_version::TLS1_2); |
|
|
|
options.set_max_tls_version(grpc_tls_version::TLS1_2); |
|
|
|
auto server_credentials = grpc::experimental::TlsServerCredentials(options); |
|
|
|
auto server_credentials = grpc::experimental::TlsServerCredentials(options); |
|
|
|