diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/csharp/Grpc.IntegrationTesting/InteropClient.cs | 6 | ||||
-rw-r--r-- | src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs | 4 | ||||
-rw-r--r-- | src/csharp/Grpc.IntegrationTesting/InteropServer.cs | 2 | ||||
-rw-r--r-- | src/csharp/Grpc.IntegrationTesting/TestCredentials.cs | 17 | ||||
-rw-r--r-- | src/node/interop/interop_client.js | 6 | ||||
-rwxr-xr-x | src/php/tests/interop/interop_client.php | 1 | ||||
-rwxr-xr-x | src/php/tests/interop/message_set.php | 26 |
7 files changed, 14 insertions, 48 deletions
diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs index 030a098cad..5eec11abf7 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs @@ -137,7 +137,11 @@ namespace Grpc.IntegrationTesting private async Task<ChannelCredentials> CreateCredentialsAsync() { - var credentials = options.UseTls.Value ? TestCredentials.CreateTestClientCredentials(options.UseTestCa.Value) : ChannelCredentials.Insecure; + var credentials = ChannelCredentials.Insecure; + if (options.UseTls.Value) + { + credentials = options.UseTestCa.Value ? TestCredentials.CreateSslCredentials() : new SslCredentials(); + } if (options.TestCase == "jwt_token_creds") { diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs b/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs index 7bc17a207f..837ae74c45 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs @@ -59,7 +59,7 @@ namespace Grpc.IntegrationTesting server = new Server { Services = { TestService.BindService(new TestServiceImpl()) }, - Ports = { { Host, ServerPort.PickUnused, TestCredentials.CreateTestServerCredentials() } } + Ports = { { Host, ServerPort.PickUnused, TestCredentials.CreateSslServerCredentials() } } }; server.Start(); @@ -68,7 +68,7 @@ namespace Grpc.IntegrationTesting new ChannelOption(ChannelOptions.SslTargetNameOverride, TestCredentials.DefaultHostOverride) }; int port = server.Ports.Single().BoundPort; - channel = new Channel(Host, port, TestCredentials.CreateTestClientCredentials(true), options); + channel = new Channel(Host, port, TestCredentials.CreateSslCredentials(), options); client = TestService.NewClient(channel); } diff --git a/src/csharp/Grpc.IntegrationTesting/InteropServer.cs b/src/csharp/Grpc.IntegrationTesting/InteropServer.cs index 29f842be2e..cd47e31c2b 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropServer.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropServer.cs @@ -102,7 +102,7 @@ namespace Grpc.IntegrationTesting int port = options.Port; if (options.UseTls.Value) { - server.Ports.Add(host, port, TestCredentials.CreateTestServerCredentials()); + server.Ports.Add(host, port, TestCredentials.CreateSslServerCredentials()); } else { diff --git a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs index 7a48d6e92e..ce108d808b 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs @@ -51,26 +51,15 @@ namespace Grpc.IntegrationTesting public const string DefaultHostOverride = "foo.test.google.fr"; public const string ClientCertAuthorityPath = "data/ca.pem"; - public const string ClientCertAuthorityEnvName = "SSL_CERT_FILE"; - public const string ServerCertChainPath = "data/server1.pem"; public const string ServerPrivateKeyPath = "data/server1.key"; - public static SslCredentials CreateTestClientCredentials(bool useTestCa) + public static SslCredentials CreateSslCredentials() { - string caPath = ClientCertAuthorityPath; - if (!useTestCa) - { - caPath = Environment.GetEnvironmentVariable(ClientCertAuthorityEnvName); - if (string.IsNullOrEmpty(caPath)) - { - throw new ArgumentException("CA path environment variable is not set."); - } - } - return new SslCredentials(File.ReadAllText(caPath)); + return new SslCredentials(File.ReadAllText(ClientCertAuthorityPath)); } - public static SslServerCredentials CreateTestServerCredentials() + public static SslServerCredentials CreateSslServerCredentials() { var keyCertPair = new KeyCertificatePair( File.ReadAllText(ServerCertChainPath), diff --git a/src/node/interop/interop_client.js b/src/node/interop/interop_client.js index b5061895cf..53ffa385bd 100644 --- a/src/node/interop/interop_client.js +++ b/src/node/interop/interop_client.js @@ -562,11 +562,11 @@ function runTest(address, host_override, test_case, tls, test_ca, done, extra) { var ca_path; if (test_ca) { ca_path = path.join(__dirname, '../test/data/ca.pem'); + var ca_data = fs.readFileSync(ca_path); + creds = grpc.credentials.createSsl(ca_data); } else { - ca_path = process.env.SSL_CERT_FILE; + creds = grpc.credentials.createSsl(); } - var ca_data = fs.readFileSync(ca_path); - creds = grpc.credentials.createSsl(ca_data); if (host_override) { options['grpc.ssl_target_name_override'] = host_override; options['grpc.default_authority'] = host_override; diff --git a/src/php/tests/interop/interop_client.php b/src/php/tests/interop/interop_client.php index 6670ef3ab9..5965097e18 100755 --- a/src/php/tests/interop/interop_client.php +++ b/src/php/tests/interop/interop_client.php @@ -33,7 +33,6 @@ */ require_once realpath(dirname(__FILE__) . '/../../vendor/autoload.php'); require 'empty.php'; -require 'message_set.php'; require 'messages.php'; require 'test.php'; use Google\Auth\CredentialsLoader; diff --git a/src/php/tests/interop/message_set.php b/src/php/tests/interop/message_set.php deleted file mode 100755 index c35c6d74b2..0000000000 --- a/src/php/tests/interop/message_set.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0 -// Source: net/proto2/bridge/proto/message_set.proto -// Date: 2014-12-03 22:02:20 - -namespace proto2\bridge { - - class MessageSet extends \DrSlump\Protobuf\Message { - - - /** @var \Closure[] */ - protected static $__extensions = array(); - - public static function descriptor() - { - $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'proto2.bridge.MessageSet'); - - foreach (self::$__extensions as $cb) { - $descriptor->addField($cb(), true); - } - - return $descriptor; - } - } -} - |