|
|
|
@ -16,16 +16,16 @@ |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#include <gmock/gmock.h> |
|
|
|
|
#include <grpc/grpc.h> |
|
|
|
|
#include <grpcpp/security/credentials.h> |
|
|
|
|
#include <grpcpp/security/server_credentials.h> |
|
|
|
|
#include <grpcpp/security/tls_credentials_options.h> |
|
|
|
|
#include <grpcpp/server_builder.h> |
|
|
|
|
#include <memory> |
|
|
|
|
|
|
|
|
|
#include <gmock/gmock.h> |
|
|
|
|
#include <grpc/grpc.h> |
|
|
|
|
#include <gtest/gtest.h> |
|
|
|
|
|
|
|
|
|
#include <memory> |
|
|
|
|
|
|
|
|
|
#include "src/core/lib/gpr/env.h" |
|
|
|
|
#include "src/core/lib/gpr/tmpfile.h" |
|
|
|
|
#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" |
|
|
|
@ -573,12 +573,13 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { |
|
|
|
|
test_server_authorization_check)); |
|
|
|
|
|
|
|
|
|
TlsCredentialsOptions options = TlsCredentialsOptions( |
|
|
|
|
GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, |
|
|
|
|
GRPC_TLS_SERVER_VERIFICATION, key_materials_config, |
|
|
|
|
credential_reload_config, server_authorization_check_config); |
|
|
|
|
grpc_tls_credentials_options* c_options = options.c_credentials_options(); |
|
|
|
|
EXPECT_EQ(c_options->cert_request_type(), |
|
|
|
|
GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY); |
|
|
|
|
GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE); |
|
|
|
|
EXPECT_EQ(c_options->server_verification_option(), |
|
|
|
|
GRPC_TLS_SERVER_VERIFICATION); |
|
|
|
|
grpc_tls_key_materials_config* c_key_materials_config = |
|
|
|
|
c_options->key_materials_config(); |
|
|
|
|
grpc_tls_credential_reload_config* c_credential_reload_config = |
|
|
|
@ -678,7 +679,6 @@ TEST_F(CredentialsTest, LoadTlsChannelCredentials) { |
|
|
|
|
test_server_authorization_check)); |
|
|
|
|
|
|
|
|
|
TlsCredentialsOptions options = TlsCredentialsOptions( |
|
|
|
|
GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, |
|
|
|
|
GRPC_TLS_SERVER_VERIFICATION, nullptr, credential_reload_config, |
|
|
|
|
server_authorization_check_config); |
|
|
|
|
std::shared_ptr<grpc_impl::ChannelCredentials> channel_credentials = |
|
|
|
|