From f99ed9b5763cb4d17b1c8397d401ef072f528c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=20Mohamad=20=E2=8C=98?= Date: Sat, 14 Dec 2024 17:30:12 +0100 Subject: [PATCH] Update TLS example in other languages (#1033) Added TLS example in other languages, following #1013 --- docs/advanced/server.de.md | 2 +- docs/advanced/server.es.md | 2 +- docs/advanced/server.nl.md | 2 +- docs/advanced/server.zh.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/advanced/server.de.md b/docs/advanced/server.de.md index fd5390a56..6ad0fb914 100644 --- a/docs/advanced/server.de.md +++ b/docs/advanced/server.de.md @@ -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)) ) ``` diff --git a/docs/advanced/server.es.md b/docs/advanced/server.es.md index 3db7ee28d..2c636ec50 100644 --- a/docs/advanced/server.es.md +++ b/docs/advanced/server.es.md @@ -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)) ) ``` diff --git a/docs/advanced/server.nl.md b/docs/advanced/server.nl.md index 68943e05a..7dc8075ea 100644 --- a/docs/advanced/server.nl.md +++ b/docs/advanced/server.nl.md @@ -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)) ) ``` diff --git a/docs/advanced/server.zh.md b/docs/advanced/server.zh.md index 9f740b637..a8c7ad64d 100644 --- a/docs/advanced/server.zh.md +++ b/docs/advanced/server.zh.md @@ -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)) ) ```