aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
diff options
context:
space:
mode:
authorGravatar Giang Nguyen <cauthu@dropbox.com>2017-10-30 10:19:17 -0500
committerGravatar Giang Nguyen <cauthu@dropbox.com>2017-11-20 23:09:56 +0000
commitbcf083fa9099e5c919f1bdbc7694705665468d3c (patch)
tree19814695e47cec1f2aca73b589af7674e4e77603 /src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
parent555b84506e22ecd5bc5cea0f2d3dcae3a1d8c108 (diff)
Add Python support for server SSL cert reloading
Previously, a secure server is configured with SSL credentials during initialization, and those credentials will be used for the lifetime of the server. If the user wants the server to use new credentials, the user has to restart the server, resulting in server downtime. This change enables the user to optionally configure the server with a "certificiate config fetcher," such that on every new client connection, the server will call the config fetcher before performing the handshake, allowing the user application to optionally specify new certificate configuration for the server to use (the fetcher can return a "no change" and the server continues to use its current certificate configuration).
Diffstat (limited to 'src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi')
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
index 41975cbe9e..bc0f185c77 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
@@ -28,12 +28,27 @@ cdef class CallCredentials:
cdef list references
+cdef class ServerCertificateConfig:
+
+ cdef grpc_ssl_server_certificate_config *c_cert_config
+ cdef const char *c_pem_root_certs
+ cdef grpc_ssl_pem_key_cert_pair *c_ssl_pem_key_cert_pairs
+ cdef size_t c_ssl_pem_key_cert_pairs_count
+ cdef list references
+
+
cdef class ServerCredentials:
cdef grpc_server_credentials *c_credentials
cdef grpc_ssl_pem_key_cert_pair *c_ssl_pem_key_cert_pairs
cdef size_t c_ssl_pem_key_cert_pairs_count
cdef list references
+ # the cert config related state is used only if this credentials is
+ # created with cert config/fetcher
+ cdef object initial_cert_config
+ cdef object cert_config_fetcher
+ # whether C-core has asked for the initial_cert_config
+ cdef bint initial_cert_config_fetched
cdef class CredentialsMetadataPlugin: