mirror of https://github.com/vapor/docs.git
Update TLS example in other languages (#1033)
Added TLS example in other languages, following #1013
This commit is contained in:
parent
b974f36893
commit
f99ed9b576
|
|
@ -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))
|
||||
)
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
)
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
)
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
)
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue