# Resource.SubscribeHttpsEndpointsUpdate

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [Resource](/reference/api/go/aspire.hosting/resource.md)
- Version: `17.0.0`
- Kind: `method`

Subscribes to the `BeforeStartEvent` and invokes the specified callback when an HTTPS certificate is determined to be available for the resource. This is used to conditionally update endpoint URI schemes or perform other HTTPS-related configuration at startup.

## Remarks

The callback is invoked when either:
-
-
Switch an endpoint to HTTPS when a certificate is available:
```
builder.SubscribeHttpsEndpointsUpdate(ctx =>
{
builder.WithEndpoint("http", ep => ep.UriScheme = "https");
});
```

## Definition

```go
func (Resource) SubscribeHttpsEndpointsUpdate(callback func(obj HttpsEndpointUpdateCallbackContext)) Resource
```

## Signature

```go
SubscribeHttpsEndpointsUpdate(callback func(obj HttpsEndpointUpdateCallbackContext)) Resource
```

## Parameters

- `callback` (`func(obj HttpsEndpointUpdateCallbackContext)`) -- The callback to invoke when HTTPS is enabled. Receives an `HttpsEndpointUpdateCallbackContext` providing access to the service provider, resource, and application model.

## Returns

[`Resource`](/reference/api/go/aspire.hosting/resource.md) -- The updated resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

A marker interface declares no methods of its own in Go. Its functions are declared on the concrete types they apply to.

- [Resource](/reference/api/go/aspire.hosting/resource.md) -- `marker`

## Applies to

- [`CSharpAppResource`](/reference/api/go/aspire.hosting/csharpappresource.md)
- [`ContainerRegistryResource`](/reference/api/go/aspire.hosting/containerregistryresource.md)
- [`ContainerResource`](/reference/api/go/aspire.hosting/containerresource.md)
- [`DotnetToolResource`](/reference/api/go/aspire.hosting/dotnettoolresource.md)
- [`ExecutableResource`](/reference/api/go/aspire.hosting/executableresource.md)
- [`ExternalServiceResource`](/reference/api/go/aspire.hosting/externalserviceresource.md)
- [`ParameterResource`](/reference/api/go/aspire.hosting/parameterresource.md)
- [`ProjectResource`](/reference/api/go/aspire.hosting/projectresource.md)
