-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
Aspire 13.1 is introducing a WithCertificateKeyPair api which can be used to inject the ASP.Net dev cert public/private key into a container. This follows on from the capabilities introduced in 13 to inject certificate trust into containers.
The DevCertHostingExtensions class, and the otel collector using this should be reworked on top of the newer apis.
https://github.com/CommunityToolkit/Aspire/blob/main/src/Shared/DevCertHostingExtensions.cs
Lines 52 to 72 in 58e5c1e
| if (!settings.ForceNonSecureReceiver && isHttpsEnabled && builder.ExecutionContext.IsRunMode) | |
| { | |
| resourceBuilder.RunWithHttpsDevCertificate(); | |
| // Not using `Path.Combine` as we MUST use unix style paths in the container | |
| var certFilePath = $"{DevCertHostingExtensions.DEV_CERT_BIND_MOUNT_DEST_DIR}/{DevCertHostingExtensions.CERT_FILE_NAME}"; | |
| var certKeyPath = $"{DevCertHostingExtensions.DEV_CERT_BIND_MOUNT_DEST_DIR}/{DevCertHostingExtensions.CERT_KEY_FILE_NAME}"; | |
| if (settings.EnableHttpEndpoint) | |
| { | |
| resourceBuilder.WithArgs( | |
| $@"--config=yaml:receivers::otlp::protocols::http::tls::cert_file: ""{certFilePath}""", | |
| $@"--config=yaml:receivers::otlp::protocols::http::tls::key_file: ""{certKeyPath}"""); | |
| } | |
| if (settings.EnableGrpcEndpoint) | |
| { | |
| resourceBuilder.WithArgs( | |
| $@"--config=yaml:receivers::otlp::protocols::grpc::tls::cert_file: ""{certFilePath}""", | |
| $@"--config=yaml:receivers::otlp::protocols::grpc::tls::key_file: ""{certKeyPath}"""); | |
| } | |
| } |
dotnet/aspire#12506
Metadata
Metadata
Assignees
Labels
No labels