grpclib icon indicating copy to clipboard operation
grpclib copied to clipboard

Adding my learning on Secure connections

Open tmsrikanth opened this issue 2 years ago • 0 comments

Its a knowledge share for member who had difficulty in creating secure channel with Client certificate. I had difficulty in creating sslcontext and passing it part of the Channel creation class. The error were more towards sslcontext creation .

Since grpclib provides support for certifi package .Internally while creating secure connection, grpclib looksup for certifi certificates repo and create default context. I updated my client certificate in the cacert.pem and it helped me to resolve my issue on secure channel creation

Picked up a small code to update the certificate details programatically. You can add wrappers for conditional update based on any condition.

cafile = certifi.where() with open(certi_path, 'rb') as infile: customca = infile.read() with open(cafile, 'ab') as outfile: outfile.write(customca)

tmsrikanth avatar Dec 02 '22 13:12 tmsrikanth