Update TLS example in other languages (#1033)

Added TLS example in other languages, following #1013
This commit is contained in:
Ale Mohamad ⌘ 2024-12-14 17:30:12 +01:00 committed by GitHub
parent b974f36893
commit f99ed9b576
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -132,7 +132,7 @@ Der Parameter _tlsConfiguration_ legt fest, ob TLS (SSL) verwendet werden soll.
// 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))
)
```

View File

@ -140,7 +140,7 @@ El parámetro `tlsConfiguration` controla si TLS (SSL) está habilitado en el se
// Habilitar 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))
)
```

View File

@ -141,7 +141,7 @@ De `tlsConfiguration` parameter regelt of TLS (SSL) is ingeschakeld op de server
// Schakel TLS in.
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))
)
```

View File

@ -140,7 +140,7 @@ app.http.server.configuration.supportVersions = [.two]
// 启用 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))
)
```