diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2015-03-04 11:29:09 -0800 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2015-03-04 11:29:09 -0800 |
commit | f7e32a669ef253679d61e3ba56497343c3170738 (patch) | |
tree | f769564c8073ab2b0da769d6571aa081c871ffb7 /src/csharp | |
parent | 0431246c1ab4497d4782473b9313e8dfb4adac8e (diff) |
C# interop client support for external CA file
Diffstat (limited to 'src/csharp')
-rw-r--r-- | src/csharp/Grpc.IntegrationTesting/InteropClient.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs index e560112a89..30301f165b 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs @@ -103,8 +103,16 @@ namespace Grpc.IntegrationTesting Credentials credentials = null; if (options.useTls) { - // TODO: use also Env variable for location of the ca file. - credentials = new SslCredentials(File.ReadAllText("data/ca.pem")); + string caPath = "data/ca.pem"; // Default testing CA + if (!options.useTestCa) + { + caPath = Environment.GetEnvironmentVariable("SSL_CERT_FILE"); + if (string.IsNullOrEmpty(caPath)) + { + throw new ArgumentException("CA path environment variable is not set."); + } + } + credentials = new SslCredentials(File.ReadAllText(caPath)); } ChannelArgs channelArgs = null; |