Open marinasundstrom opened 4 months ago
Thanks, this saved me some time.
I had an issue where the certificates alt name has to be the hostname of the app(?).
For instance:
builder.AddProject<Projects.Api>("api");
Yarp tries to resolve https://api/endpoint, and when your dev cert is only signed for localhost you will get a RemoteCertificateNameMismatch
error.
Guessing the best way is to buypass ssl check on local development?
@bjornstensberg I've had that problem too, I would like to get those ServiceDiscovery URLs with SSL to work too.
I have to bypass it by specifying the localhost address with the actual port, in the YARP config.
But then, I guess that non-SSL is acceptable within a cloud. It is just that the public endpoint is protected.
@davidfowl Is there a working example of YARP in Aspire using SSL? I end up on this issue but I can't figure out a solution.
Here are some of my experiences configuring this resource.
I copied the code and modified it to work with SSL/HTTPS.
The first problem was that the SlimBuilder didn't configure SSL. So had to add that:
I tried this but it didn't work:
I guess that I missed something here.
Instead:
I also had to change the scheme for the routes since my apps use
https
(which might not be necessary to run as):Change part of the string literal to
`https
:For the dev certificate to work you need to set the environment variable:
In some cases perhaps
UseHttpsRedirection
would be necessary too.Full config: