Blame
|
1 | # Set Up HTTPS |
||||||
| 2 | ||||||||
| 3 | LubeLogger runs on Kestrel, which is a cross-platform standalone web server provided by .NET |
|||||||
| 4 | ||||||||
| 5 | If you're running LubeLogger behind a reverse proxy(i.e. NGINX), then this walkthrough does not apply to you since the SSL certs will be served up by NGINX instead of Kestrel. |
|||||||
| 6 | ||||||||
| 7 | This article covers the step-by-step process to set up HTTPS for a LubeLogger instance. |
|||||||
| 8 | ||||||||
| 9 | ## Docker |
|||||||
| 10 | If you're running LubeLogger on a Docker instance, first read [this article by Microsoft](https://learn.microsoft.com/en-us/aspnet/core/security/docker-compose-https?view=aspnetcore-8.0) |
|||||||
| 11 | ||||||||
| 12 | 1. Convert the .PEM / .CRT files into .PFX, read [this StackOverflow post](https://stackoverflow.com/questions/808669/convert-a-cert-pem-certificate-to-a-pfx-certificate) |
|||||||
| 13 | 2. Open and modify the .env file and add the following lines(note that in this example I used bob as the password for the cert) |
|||||||
|
14 | > [!NOTE] |
||||||
| 15 | > You can use the [LubeLogger Configurator](https://lubelogger.com/configure) |
|||||||
|
16 | > for this step |
||||||
|
17 | ``` |
||||||
| 18 | ASPNETCORE_Kestrel__Certificates__Default__Password=bob |
|||||||
| 19 | ASPNETCORE_Kestrel__Certificates__Default__Path=/https/<yourPFXCertificateName>.pfx |
|||||||
| 20 | ASPNETCORE_URLS=https://+:443;http://+:80 |
|||||||
| 21 | ``` |
|||||||
|
22 | 3. Open and modify docker-compose.yml. You will need to bind a new volume to the Docker container so that Kestrel can access the certificate file. |
||||||
|
23 | ``` |
||||||
| 24 | volumes: |
|||||||
|
25 | - ./https/:/https:ro |
||||||
|
26 | ``` |
||||||
|
27 | 4. Check the port bindings to ensure that traffic is being forwarded to port 443 |
||||||
|
28 | ``` |
||||||
| 29 | ports: |
|||||||
| 30 | - 443:443 |
|||||||
| 31 | ``` |
|||||||
| 32 | 5. Run `docker-compose up -d` to start up the container and `https://localhost` will now have a valid cert. |
|||||||
|
33 | |||||||
| 34 | ## Windows |
|||||||
|
35 | If you're running LubeLogger as the standalone Windows executable: |
||||||
|
36 | |||||||
| 37 | 1. Convert the .PEM / .CRT files into .PFX, read [this StackOverflow post](https://stackoverflow.com/questions/808669/convert-a-cert-pem-certificate-to-a-pfx-certificate) |
|||||||
|
38 | 2. Navigate to the Server Settings Configurator and click Next until you get to "Server Endpoints" |
||||||
|
39 | |||||||
|
40 |  |
||||||
|
41 | |||||||
| 42 | Note: Replace `0.0.0.0` with your IPv4 address |
|||||||
|
43 | |||||||
|
44 | 3. Save the Settings by clicking to the end of the Server Settings Configurator and click "Save" |
||||||
| 45 | 4. Restart the app and `https://localhost` will now have a valid cert. |
|||||||
