1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * 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
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * 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.
16  *
17  */
18 
19 #import "GRPCCall.h"
20 
21 /**
22  * 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.
24  */
25 @interface GRPCCall (Tests)
26 
27 /**
28  * 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|.
30  *
31  * 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.
33  */
34 + (void)useTestCertsPath:(NSString *)certsPath
35                 testName:(NSString *)testName
36                  forHost:(NSString *)host;
37 
38 /**
39  * Establish all connections to the provided host using cleartext instead of SSL.
40  *
41  * 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.
43  */
44 + (void)useInsecureConnectionsForHost:(NSString *)host;
45 
46 /**
47  * Resets all host configurations to their default values, and flushes all connections from the
48  * cache.
49  */
50 + (void)resetHostSettings;
51 @end
52