Skip to content

Update channel-credentials.md #24051

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

Merged
merged 9 commits into from
Jun 28, 2021
Merged

Conversation

stebet
Copy link
Contributor

@stebet stebet commented May 5, 2021

Summary

Adding details for a workaround needed for PEM loaded client certificates on Windows.

Adding workaround for PEM loaded client certificates on Windows.
@adegeo
Copy link
Contributor

adegeo commented May 5, 2021

@stebet Hi! Thank you for the submission. Did you test this code? I spotted a code error in your submission. After reading the thread I'm not sure this workaround applies. The thread states that when the certificate is imported with in-memory key, it fails. Is the code prior to your submission doing that? It looks like it's using files passed on program args.

@adegeo adegeo added the needs-more-info Needs more info from OP. Auto-closed after 2 weeks if no response. [org][resolution] label May 5, 2021
@stebet
Copy link
Contributor Author

stebet commented May 5, 2021

@stebet Hi! Thank you for the submission. Did you test this code? I spotted a code error in your submission. After reading the thread I'm not sure this workaround applies. The thread states that when the certificate is imported with in-memory key, it fails. Is the code prior to your submission doing that? It looks like it's using files passed on program args.

That's why I mentioned specifically in the note that if you are loading the client cert via PEM strings instead of files (PFX + password), you'll need to apply this workaround.

The example above the note shows only one of several ways to load a client certificate and having hit the issue myself after having followed this method (despite loading the cert differently which is just one line in the code) and scratching my head for several hours trying to figure out why this didn't work, I felt a note here might be helpful.

Maybe adding another example that shows the PEM way + workaround as an alternative instead of the note would be clearer?

This is in my opinion pretty important info for anyone using client certificate authentication with ephemeral keys in gRPC to be aware of.

@stebet
Copy link
Contributor Author

stebet commented May 13, 2021

Maybe @blowdart or @JamesNK have some ideas/opinions here?

@adegeo
Copy link
Contributor

adegeo commented May 13, 2021

@stebet sorry for the delay. I'm just curious if the note intro should be modified to explain exactly why this code would be needed. It sounds like it's always needed. (I'm not super familiar with cert management though) The intro doesn't specify it's in-memory keys such as a string etc..

@stebet
Copy link
Contributor Author

stebet commented May 13, 2021

@stebet sorry for the delay. I'm just curious if the note intro should be modified to explain exactly why this code would be needed. It sounds like it's always needed. (I'm not super familiar with cert management though) The intro doesn't specify it's in-memory keys such as a string etc..

No need to be sorry :)

Changing the intro a bit makes sense. I'll reword and make a few changes to explain it better and why it's needed.

@stebet
Copy link
Contributor Author

stebet commented May 29, 2021

Got delayed a bit with other tasks. I'll take a look at this after the weekend.

Making it clear when the workaround should be applied.
@stebet
Copy link
Contributor Author

stebet commented Jun 3, 2021

@adegeo I added another example section that hopefully clarifies the example and note a bit better.

Fixing after code review.

Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com>
@stebet stebet requested a review from adegeo June 6, 2021 13:28
@BillWagner BillWagner modified the milestones: May 2021, June 2021 Jun 7, 2021
Copy link
Contributor

@adegeo adegeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you for being so patient!

@adegeo adegeo merged commit c16301d into dotnet:main Jun 28, 2021
@stebet stebet deleted the grpc-client-cert-workaround branch June 30, 2021 13:28
Youssef1313 pushed a commit to Youssef1313/docs that referenced this pull request Jul 5, 2021
* Update channel-credentials.md

Adding workaround for PEM loaded client certificates on Windows.

* Fix markdown errors

* Update channel-credentials.md

Making it clear when the workaround should be applied.

* Update docs/architecture/grpc-for-wcf-developers/channel-credentials.md

Fixing after code review.

Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com>

* Update docs/architecture/grpc-for-wcf-developers/channel-credentials.md

Co-authored-by: David Pine <david.pine@microsoft.com>

* Update docs/architecture/grpc-for-wcf-developers/channel-credentials.md

Co-authored-by: David Pine <david.pine@microsoft.com>

* Update docs/architecture/grpc-for-wcf-developers/channel-credentials.md

Co-authored-by: David Pine <david.pine@microsoft.com>

* Intro paras; formatting.

* Update channel-credentials.md

Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com>
Co-authored-by: David Pine <david.pine@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-architecture/svc grpc/subsvc needs-more-info Needs more info from OP. Auto-closed after 2 weeks if no response. [org][resolution]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants