how to set cert file to yarp for ssl #2321
-
How can I implement ssl on yarp? ClientCertForwards the client cert used on the inbound connection as a header to destination
Config:
Code:
Example:
As the inbound and outbound connections are independent, there needs to be a way to pass any inbound client certificate to the destination server. This transform causes the client certificate taken from Servers do minimal validation on the incoming client certificate by default. The certificate should be validated either in the proxy or the destination, see the client certificate auth docs for details. This transform will only apply if the client certificate is already present on the connection. See the optional certs doc if it needs to be requested from the client on a per-route basis. Where should I write these codes in the service?
Example:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The Do you mean that you want to accept inbound HTTPS/TLS connections and then proxy them? YARP doesn't configure the inbound connections, that's AspNetCore / Kestrel. Or do you want YARP to authenticate to the destination server using a client certificate? If you want to add a certificate for YARP to use when authenticating to the destination then try this: |
Beta Was this translation helpful? Give feedback.
The
X-Client-Cert
description above is used to pass the client's client certificate through the proxy to the destination, not a certificate provided by YARP.Do you mean that you want to accept inbound HTTPS/TLS connections and then proxy them?
YARP doesn't configure the inbound connections, that's AspNetCore / Kestrel.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-7.0#listenoptionsusehttps
Or do you want YARP to authenticate to the destination server using a client certificate? If you want to add a certificate for YARP to use when authenticating to the destination then try this:
https://microsoft.github.io/reverse-proxy/articles/http…