Skip to content

Commit

Permalink
Merge pull request grpc#16640 from mehrdada/fix-ssl-credentials-null
Browse files Browse the repository at this point in the history
Fix SSL channel credential when an argument is None
  • Loading branch information
mehrdada authored Sep 17, 2018
2 parents ef60c57 + 3586ac1 commit 1461017
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,14 @@ cdef class SSLChannelCredentials(ChannelCredentials):
return grpc_ssl_credentials_create(
c_pem_root_certificates, NULL, NULL, NULL)
else:
c_pem_key_certificate_pair.private_key = self._private_key
c_pem_key_certificate_pair.certificate_chain = self._certificate_chain
if self._private_key:
c_pem_key_certificate_pair.private_key = self._private_key
else:
c_pem_key_certificate_pair.private_key = NULL
if self._certificate_chain:
c_pem_key_certificate_pair.certificate_chain = self._certificate_chain
else:
c_pem_key_certificate_pair.certificate_chain = NULL
return grpc_ssl_credentials_create(
c_pem_root_certificates, &c_pem_key_certificate_pair, NULL, NULL)

Expand Down

0 comments on commit 1461017

Please sign in to comment.