-
Notifications
You must be signed in to change notification settings - Fork 420
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
NIOSSL: How to include a client certificate in the gRPC request context to server ? #1872
Comments
The first thing that comes to mind is whether the go client is setting any metadata that the server is reading. Can you check what metadata the server receives when queried by the go client? |
I added a JWT to the header and that server is able to see.
When I printed the |
I'm not sure to be honest, I don't know how the Go server decides whether extract the certificate. If you can figure that bit out then hopefully we can understand what the Swift client isn't doing. |
@glbrntt First of all thanks for looking into it. I looked into the code bit more to see how the Go server looks for certs in the request context.
Basically it uses https://pkg.go.dev/google.golang.org/grpc/peer#FromContext to extract the |
The code in OP looks wrong. Specifically, this call:
You aren't providing a private key here. This cannot successfully present a cert to the server, so presumably you aren't. |
@Lukasa Maybe thats the issue. The reason I dont have the private key set is that the client certificate is hardware-backed i.e the private key is in Secure Enclave and not available on disk. I can see in Mac logs, the CryptoTokenKit extension running on the Mac provides the private key ref for signing when the cert is accessed (for example mTLS in browser). I was hoping it can still send the certificate(with the public key) from the Keychain since it can find it with |
It looks like we can’t convert a What do you suggest ? In future will hardware-backed client certs be supported ? |
You can do this using |
What are you trying to achieve?
I want to include a client certificate in the gRPC context in the request.
My server(in Golang) looks for this certificate along with some custom metadata:
Note: This works fine with a Linux Golang based client gRPC connection.
What have you tried so far?
I included the client certificate in the
TLSConfiguration
but the context in the server end doesn't have any certificate:What am I missing ?
The text was updated successfully, but these errors were encountered: