From 1d4a95bf7d559a881fcb34d2544708130035dc19 Mon Sep 17 00:00:00 2001 From: Ross Miller Date: Sat, 7 Mar 2026 16:27:48 +0000 Subject: [PATCH] Updated README --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index 8724911..13eb608 100644 --- a/README.md +++ b/README.md @@ -144,3 +144,45 @@ Add client credentials to `appsettings.json` (or via environment / user-secrets) ## Licence This project is provided as-is for personal use. +## Using Custom SSL Certificates + +To enable HTTPS with custom SSL certificates in your Blazor application, follow these steps: + +1. **Prepare PEM Files** + Place your certificate and private key files in PEM format in a directory accessible by your app. + Example paths: + - `/app/data/certs/cert.pem` + - `/app/data/certs/key.pem` + +2. **Configure Certificate Paths** + The application will look for certificate files in the following order: + - Environment variables: `PEM_CERT_FILE` and `PEM_KEY_FILE` + - Configuration values: `PemCertFile` and `PemKeyFile` in `appsettings.json` + - Default: `/app/data/certs/cert.pem` and `/app/data/certs/key.pem` + + You can set environment variables before running the app: + ```bash + export PEM_CERT_FILE=/path/to/cert.pem + export PEM_KEY_FILE=/path/to/key.pem + ``` + + Or add to your `appsettings.json`: + ```json + { + "PemCertFile": "/path/to/cert.pem", + "PemKeyFile": "/path/to/key.pem" + } + ``` + +3. **Fallback Behavior** + If the certificate files are not found, the app will use the default development certificate. + +4. **No Code Changes Needed** + The certificate loading logic is already implemented in `Program.cs`. Simply provide the files and configuration as described above. + +--- + +**Note:** +- Certificates must be in PEM format (`.pem`). +- Ensure file permissions allow the app to read the certificate and key files. +- For production, use certificates issued by a trusted Certificate Authority.