Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Eureka docs for mTLS #328

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions api/v4/discovery/netflix-eureka.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,25 +203,28 @@ the meaning of the metadata.

## Configuring mutual TLS

To use mutual TLS authentication in the communication with the Eureka server, follow these steps:

1. Add a NuGet package reference to `Steeltoe.Common.Security`
1. From your `Program.cs`, load the client certificate into configuration:
```c#
builder.Configuration.AddPemFiles("instance.crt", "instance.key");
```
or:
```c#
builder.Configuration.AddCertificateFile("instance.p12");
```
or add your custom implementation of `ICertificateSource`
1. Load the certificate into ASP.NET options:
```c#
builder.Services.AddSingleton<IConfigureOptions<CertificateOptions>, PemConfigureCertificateOptions>();
```
To use mutual TLS authentication in the communication with the Eureka server,
add the path to your certificate file(s) to `appsettings.json`. For example:

```json
"Certificates": {
"Eureka": {
"CertificateFilePath": "example.p12"
}
}
```
or:
```json
"Certificates": {
"Eureka": {
"CertificateFilePath": "example.crt",
"PrivateKeyFilePath": "example.key"
}
}
```

> [!TIP]
> You can use a single `ICertificateSource` for both Eureka and [Config Server mTLS connections](../configuration/config-server-provider.md#configuring-mutual-tls).
> [!NOTE]
> To support certificate rotation, the configuration keys and the files on disk are automatically monitored for changes.

### Using custom HTTP headers

Expand Down
Loading