GRPC Core  9.0.0
ssl_security_connector.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 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 #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_SSL_SECURITY_CONNECTOR_H
20 #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_SSL_SECURITY_CONNECTOR_H
21 
23 
24 #include <grpc/grpc_security.h>
25 
27 
31 
32 typedef struct {
37 
38 /* Creates an SSL channel_security_connector.
39  - request_metadata_creds is the credentials object which metadata
40  will be sent with each request. This parameter can be NULL.
41  - config is the SSL config to be used for the SSL channel establishment.
42  - is_client should be 0 for a server or a non-0 value for a client.
43  - secure_peer_name is the secure peer name that should be checked in
44  grpc_channel_security_connector_check_peer. This parameter may be NULL in
45  which case the peer name will not be checked. Note that if this parameter
46  is not NULL, then, pem_root_certs should not be NULL either.
47  - sc is a pointer on the connector to be created.
48  This function returns GRPC_SECURITY_OK in case of success or a
49  specific error code otherwise.
50 */
55  const grpc_ssl_config* config, const char* target_name,
56  const char* overridden_target_name,
57  tsi_ssl_session_cache* ssl_session_cache);
58 
59 /* Config for ssl servers. */
60 typedef struct {
61  tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs = nullptr;
62  size_t num_key_cert_pairs = 0;
63  char* pem_root_certs = nullptr;
64  grpc_ssl_client_certificate_request_type client_certificate_request =
67 
68 /* Creates an SSL server_security_connector.
69  - config is the SSL config to be used for the SSL channel establishment.
70  - sc is a pointer on the connector to be created.
71  This function returns GRPC_SECURITY_OK in case of success or a
72  specific error code otherwise.
73 */
77 
78 #endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_SSL_SECURITY_CONNECTOR_H \
79  */
Definition: ref_counted_ptr.h:35
grpc_ssl_client_certificate_request_type
Definition: grpc_security_constants.h:59
@ GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE
Server does not request client certificate.
Definition: grpc_security_constants.h:64
grpc_core::RefCountedPtr< grpc_channel_security_connector > grpc_ssl_channel_security_connector_create(grpc_core::RefCountedPtr< grpc_channel_credentials > channel_creds, grpc_core::RefCountedPtr< grpc_call_credentials > request_metadata_creds, const grpc_ssl_config *config, const char *target_name, const char *overridden_target_name, tsi_ssl_session_cache *ssl_session_cache)
Definition: ssl_security_connector.cc:406
grpc_core::RefCountedPtr< grpc_server_security_connector > grpc_ssl_server_security_connector_create(grpc_core::RefCountedPtr< grpc_server_credentials > server_credentials)
Definition: ssl_security_connector.cc:445
struct tsi_ssl_session_cache tsi_ssl_session_cache
Definition: ssl_transport_security.h:58
Definition: ssl_security_connector.h:32
char * pem_root_certs
Definition: ssl_security_connector.h:34
verify_peer_options verify_options
Definition: ssl_security_connector.h:35
tsi_ssl_pem_key_cert_pair * pem_key_cert_pair
Definition: ssl_security_connector.h:33
Definition: ssl_security_connector.h:60
Definition: ssl_transport_security.h:78
Deprecated in favor of grpc_ssl_verify_peer_options.
Definition: grpc_security.h:170