Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding my learning on Secure connections #167

Open
tmsrikanth opened this issue Dec 2, 2022 · 0 comments
Open

Adding my learning on Secure connections #167

tmsrikanth opened this issue Dec 2, 2022 · 0 comments

Comments

@tmsrikanth
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant