You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For advanced scenarios, you can specify custom certificate trust behavior using callback APIs. These callbacks allow you to customize how certificates are configured for different resource types.
152
+
For advanced scenarios, you can specify custom certificate trust behavior using a callback API. This callback allows you to customize the command line arguments and environment variables required to configure certificate trust for different resource types.
153
153
154
-
### Executable resource certificate trust
154
+
### Configure certificate trust with a callback
155
155
156
-
Use `WithExecutableCertificateTrustCallback` to customize certificate trust for executable resources:
156
+
Use `WithCertificateTrustConfiguration` to customize how certificate trust is configured for a resource:
The callback receives an `ExecutableCertificateTrustCallbackAnnotationContext` that provides:
180
+
The callback receives a `CertificateTrustConfigurationCallbackAnnotationContext` that provides:
181
+
182
+
-`Scope`: The `CertificateTrustScope` for the resource.
183
+
-`Arguments`: Command line arguments for the resource. Values can be strings or path providers like `CertificateBundlePath` or `CertificateDirectoriesPath`.
184
+
-`EnvironmentVariables`: Environment variables for configuring certificate trust. The dictionary key is the environment variable name; values can be strings or path providers. By default, includes `SSL_CERT_DIR` and may include `SSL_CERT_FILE` if Override or System scope is configured.
185
+
-`CertificateBundlePath`: A value provider that resolves to the path of a custom certificate bundle file.
186
+
-`CertificateDirectoriesPath`: A value provider that resolves to paths containing individual certificates.
183
187
184
-
-`Certificates`: The `X509Certificate2Collection` of certificates for this resource.
185
-
-`Scope`: The `CertificateTrustScope` of trust for the resource.
186
-
-`CertificateTrustArguments`: Command line arguments required to enable certificate trust.
187
-
-`CertificateBundleArguments`: Command line arguments that will be combined with the path to the custom certificates bundle.
188
-
-`CertificateBundleEnvironment`: Environment variable names that will be set with the path to the custom certificates bundle.
189
-
-`CertificatesDirectoryEnvironment`: Environment variable names that will be set with paths to directories containing CA certificates to trust.
188
+
Default implementations are provided for Node.js, Python, and container resources. Container resources rely on standard OpenSSL configuration options, with default values that support the majority of common Linux distributions.
190
189
191
-
### Container resource certificate trust
190
+
### Configure container certificate paths
192
191
193
-
Use `WithContainerCertificateTrustCallback` to customize certificate trust for container resources:
192
+
For container resources, you can customize where certificates are stored and accessed using `WithContainerCertificatePaths`:
The callback receives a `ContainerCertificateTrustCallbackAnnotationContext` that provides:
206
+
The `WithContainerCertificatePaths` API accepts three optional parameters:
228
207
229
-
-`Certificates`: The `X509Certificate2Collection` of certificates for this resource.
230
-
-`Scope`: The `CertificateTrustScope` of trust for the resource.
231
-
-`CustomCertificatesContainerFilePath`: The path in the container where custom certificates will be placed (defaults to `/usr/lib/ssl/aspire`).
232
-
-`DefaultContainerCertificateAuthorityBundlePaths`: List of default certificate bundle files in the container that will be replaced in Override mode.
233
-
-`DefaultContainerCertificatesDirectoryPaths`: List of default certificate directories in the container that will be appended to in Append mode.
234
-
-`CertificateTrustArguments`: Command line arguments required to enable certificate trust.
235
-
-`CertificateBundleArguments`: Command line arguments that will be combined with the path to the custom certificates bundle.
236
-
-`CertificateBundleEnvironment`: Environment variable names that will be set with the path to the custom certificates bundle.
237
-
-`CertificatesDirectoryEnvironment`: Environment variable names that will be set with paths to directories containing CA certificates (defaults include `SSL_CERT_DIR` for OpenSSL compatibility).
208
+
-`customCertificatesDestination`: Overrides the base path in the container where custom certificate files are placed. If not set or set to `null`, the default path of `/usr/lib/ssl/aspire` is used.
209
+
-`defaultCertificateBundlePaths`: Overrides the path(s) in the container where a default certificate authority bundle file is located. When the `CertificateTrustScope` is Override or System, the custom certificate bundle is additionally written to these paths. If not set or set to `null`, a set of default certificate paths for common Linux distributions is used.
210
+
-`defaultCertificateDirectoryPaths`: Overrides the path(s) in the container where individual trusted certificate files are found. When the `CertificateTrustScope` is Append, these paths are concatenated with the path to the uploaded certificate artifacts. If not set or set to `null`, a set of default certificate paths for common Linux distributions is used.
238
211
239
-
Default implementations are provided for Node.js, Python, and container resources. Container resources rely on standard OpenSSL configuration options, with default values that support the majority of common Linux distributions. You can override these defaults if necessary.
212
+
> [!NOTE]
213
+
> All desired paths must be configured in a single call to `WithContainerCertificatePaths` as only the most recent call to the API is honored.
0 commit comments