grpclib
grpclib copied to clipboard
Adding my learning on Secure connections
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)