diff --git a/Dockerfile b/Dockerfile index ee016b3..39b8bab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ ARG ARCH=armv7hf ARG REPO=axisecp ARG VERSION=1.14 ARG UBUNTU_VERSION=22.04 +ARG GRPC_VERSION=v1.65.5 FROM arm64v8/ubuntu:${UBUNTU_VERSION} AS containerized_aarch64 FROM arm32v7/ubuntu:${UBUNTU_VERSION} AS containerized_armv7hf @@ -46,6 +47,7 @@ FROM build_base AS testdata # Install Edge TPU compiler SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# hadolint ignore=DL3009 RUN < creds = grpc::SslCredentials(ssl_opts); - shared_ptr channel = CreateChannel(target, creds); + grpc::ChannelArguments args; + // gRPC/ssl doesn't support skipping server common-name verification so we force target name to + // localhost as used in the cert creation. + args.SetSslTargetNameOverride("localhost"); + shared_ptr channel = grpc::CreateCustomChannel(target, creds, args); + ASSERT_TRUE(channel->WaitForConnected( gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(5, GPR_TIMESPAN)))); unique_ptr stub = PredictionService::NewStub(channel); @@ -566,7 +571,11 @@ TEST(InferenceTest, ServerAuthenticationDlpu) { string root_cert = read_text(serverCertificatePath); SslCredentialsOptions ssl_opts = {root_cert.c_str(), "", ""}; shared_ptr creds = grpc::SslCredentials(ssl_opts); - shared_ptr channel = CreateChannel(target, creds); + grpc::ChannelArguments args; + // gRPC/ssl doesn't support skipping server common-name verification so we force target name to + // localhost as used in the cert creation. + args.SetSslTargetNameOverride("localhost"); + shared_ptr channel = grpc::CreateCustomChannel(target, creds, args); ASSERT_TRUE(channel->WaitForConnected( gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(5, GPR_TIMESPAN)))); unique_ptr stub = PredictionService::NewStub(channel); @@ -657,7 +666,11 @@ TEST(InferenceTest, ServerAuthenticationTpu) { string root_cert = read_text(serverCertificatePath); SslCredentialsOptions ssl_opts = {root_cert.c_str(), "", ""}; shared_ptr creds = grpc::SslCredentials(ssl_opts); - shared_ptr channel = CreateChannel(target, creds); + grpc::ChannelArguments args; + // gRPC/ssl doesn't support skipping server common-name verification so we force target name to + // localhost as used in the cert creation. + args.SetSslTargetNameOverride("localhost"); + shared_ptr channel = grpc::CreateCustomChannel(target, creds, args); ASSERT_TRUE(channel->WaitForConnected( gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(5, GPR_TIMESPAN)))); unique_ptr stub = PredictionService::NewStub(channel);