-
Our destination app needs the client certificate from the user accessing the app. If we set the certificate in the handler.SslOptions.ClientCertificates, it works perfectly. The problem Is, only the certificate that was that was configured during the initialization is sent. We need to be able to send the certificate that was sent in from the caller to the destination app. When we use the builderContext.AddClientCertHeader(headerName: "ssl.ClientCertificate"), the certificate is sent, but the certificate is in the header and the downstream app cannot process. Is there a way for Yarp to dynamically set the handler.SSLOptions.ClientCertificate certificate value with the certificate that was sent in from the app calling Yarp? Thank you very much for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
AddClientCertHeader is the standard way to pass client certificates from a proxy to the app. You can't pass on a certificate via SSLOptions because you don't have the private key. See this doc for configuring an app to consume the client cert from a header: |
Beta Was this translation helpful? Give feedback.
-
Hi Tratcher, thank you so much for taking the time to answer. I tried the AddCertificateForwarding before but never could get the certificate to be sent in the correct section of the call. I will try again however. Thank you again and have a nice day. |
Beta Was this translation helpful? Give feedback.
It's not possible to forward a client cert that way, you don't have the private key. That's a TLS limitation/protection, not YARP or HttpClient issue. Forwarding via header is the only option.