diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2016-04-28 00:01:16 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2016-04-28 00:01:16 +0200 |
commit | acbd8675a283a51a409991ac1393294c9af726e7 (patch) | |
tree | 01fa0ca4b463fd84edb3d3fbe2751ad76229b9d9 /src/csharp/Grpc.IntegrationTesting/TestCredentials.cs | |
parent | 23df75a97054822e1a7f89ab5a0601d6bd4b3aa6 (diff) | |
parent | cec42984a0374465de9b2626f16b0efa960a66d0 (diff) |
Merge branch 'master' of https://github.com/grpc/grpc into what-the-fuzz
Diffstat (limited to 'src/csharp/Grpc.IntegrationTesting/TestCredentials.cs')
-rw-r--r-- | src/csharp/Grpc.IntegrationTesting/TestCredentials.cs | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs index ce108d808b..774563d752 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs @@ -35,6 +35,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Reflection; using System.Text.RegularExpressions; using System.Threading.Tasks; using Grpc.Core; @@ -50,9 +51,29 @@ namespace Grpc.IntegrationTesting { public const string DefaultHostOverride = "foo.test.google.fr"; - public const string ClientCertAuthorityPath = "data/ca.pem"; - public const string ServerCertChainPath = "data/server1.pem"; - public const string ServerPrivateKeyPath = "data/server1.key"; + public static string ClientCertAuthorityPath + { + get + { + return GetPath("data/ca.pem"); + } + } + + public static string ServerCertChainPath + { + get + { + return GetPath("data/server1.pem"); + } + } + + public static string ServerPrivateKeyPath + { + get + { + return GetPath("data/server1.key"); + } + } public static SslCredentials CreateSslCredentials() { @@ -66,5 +87,11 @@ namespace Grpc.IntegrationTesting File.ReadAllText(ServerPrivateKeyPath)); return new SslServerCredentials(new[] { keyCertPair }); } + + private static string GetPath(string relativePath) + { + var assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + return Path.Combine(assemblyDir, relativePath); + } } } |