Update TLS example in Docs (#1013)

The enable TLS example didn't work for me locally. I eventually figured
out that `NIOSSLPrivateKeySource` was required.
This commit is contained in:
btc100k 2024-12-17 04:03:24 -08:00 committed by GitHub
parent 512138578a
commit 399b55f27f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ The `tlsConfiguration` parameter controls whether TLS (SSL) is enabled on the se
// Enable TLS.
app.http.server.configuration.tlsConfiguration = .makeServerConfiguration(
certificateChain: try NIOSSLCertificate.fromPEMFile("/path/to/cert.pem").map { .certificate($0) },
privateKey: .file("/path/to/key.pem")
privateKey: try NIOSSLPrivateKey(file: "/path/to/key.pem", format: .pem))
)
```