Skip to content

Commit

Permalink
Add clearer instructions for making a simple HTTPS server for testing (
Browse files Browse the repository at this point in the history
…#2269)

This includes clear instructions on how to generate a self-signed TLS certificate,
and where to store it.
  • Loading branch information
abcpro1 authored Jul 27, 2023
1 parent 5dbcb2e commit fd7a239
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions docs/examples/basic/https-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ object HttpsHelloWorld extends ZIOAppDefault {
).toHttpApp

/**
* In this example an inbuilt API using keystore is used. For testing this
* example using curl, setup the certificate named "server.crt" from resources
* for the OS. Alternatively you can create the keystore and certificate using
* the following link
* https://medium.com/@maanadev/netty-with-https-tls-9bf699e07f01
* In this example, a private key and certificate are loaded from resources.
* For testing this example with curl, make sure the private key "server.key",
* and the certificate "server.crt" are inside the resources directory,
* which is by default "src/main/resources".
*
* You can use the following command to create a self-signed TLS certificate.
* This command will create two files: "server.key" and "server.crt".
*
* openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes \
* -keyout server.key -out server.crt \
* -subj "/CN=example.com/OU=?/O=?/L=?/ST=?/C=??" \
* -addext "subjectAltName=DNS:example.com,DNS:www.example.com,IP:10.0.0.1"
*/

val sslConfig = SSLConfig.fromResource(
Expand Down

0 comments on commit fd7a239

Please sign in to comment.