blob: 5d35182ae52c4926e225ced4ebc9d0c42ddb0e46 [file] [log] [blame]
Jorge Canizalese8543b02015-08-01 17:37:40 -07001/*
2 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003 * Copyright 2015 gRPC authors.
Jorge Canizalese8543b02015-08-01 17:37:40 -07004 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02005 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
Jorge Canizalese8543b02015-08-01 17:37:40 -07008 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009 * http://www.apache.org/licenses/LICENSE-2.0
Jorge Canizalese8543b02015-08-01 17:37:40 -070010 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +020011 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
Jorge Canizalese8543b02015-08-01 17:37:40 -070016 *
17 */
18
19#import "GRPCCall.h"
20
Jorge Canizalesb10776c2015-10-26 10:44:55 -070021/**
Muxi Yan2c88b462016-10-28 10:47:25 -070022 * Methods to let tune down the security of gRPC connections for specific hosts. These shouldn't be
23 * used in releases, but are sometimes needed for testing.
Jorge Canizalesb10776c2015-10-26 10:44:55 -070024 */
Jorge Canizalese8543b02015-08-01 17:37:40 -070025@interface GRPCCall (Tests)
26
Jorge Canizalesb10776c2015-10-26 10:44:55 -070027/**
Muxi Yan2c88b462016-10-28 10:47:25 -070028 * Establish all SSL connections to the provided host using the passed SSL target name and the root
29 * certificates found in the file at |certsPath|.
Jorge Canizalesb10776c2015-10-26 10:44:55 -070030 *
Muxi Yan2c88b462016-10-28 10:47:25 -070031 * Must be called before any gRPC call to that host is made. It's illegal to pass the same host to
32 * more than one invocation of the methods of this category.
Jorge Canizalesb10776c2015-10-26 10:44:55 -070033 */
Jorge Canizalese8543b02015-08-01 17:37:40 -070034+ (void)useTestCertsPath:(NSString *)certsPath
35 testName:(NSString *)testName
36 forHost:(NSString *)host;
37
Jorge Canizalesb10776c2015-10-26 10:44:55 -070038/**
Muxi Yan2c88b462016-10-28 10:47:25 -070039 * Establish all connections to the provided host using cleartext instead of SSL.
Jorge Canizalesb10776c2015-10-26 10:44:55 -070040 *
Muxi Yan2c88b462016-10-28 10:47:25 -070041 * Must be called before any gRPC call to that host is made. It's illegal to pass the same host to
42 * more than one invocation of the methods of this category.
Jorge Canizalesb10776c2015-10-26 10:44:55 -070043 */
Jorge Canizalesb2bd0672015-08-01 23:19:11 -070044+ (void)useInsecureConnectionsForHost:(NSString *)host;
Jorge Canizales6af4add2016-07-28 23:05:18 -070045
46/**
Muxi Yan2c88b462016-10-28 10:47:25 -070047 * Resets all host configurations to their default values, and flushes all connections from the
48 * cache.
Jorge Canizales6af4add2016-07-28 23:05:18 -070049 */
Jorge Canizales32fde7a2016-07-29 17:31:07 -070050+ (void)resetHostSettings;
Jorge Canizalese8543b02015-08-01 17:37:40 -070051@end