Skip to content

Add HTTPS support through configuration options#34

Merged
evanebb merged 3 commits intomainfrom
feature/https
Sep 9, 2023
Merged

Add HTTPS support through configuration options#34
evanebb merged 3 commits intomainfrom
feature/https

Conversation

@evanebb
Copy link
Copy Markdown
Owner

@evanebb evanebb commented Sep 9, 2023

Closes #14

This PR adds the ability to configure the web server to use HTTPS instead of HTTP.

This adds three new (internal) configuration directives, httpsEnabled, httpsCertFile and httpsKeyFile. The last two respectively contain the path to the certificate file and the path to the key file. If both of these have been passed, the httpsEnabled directive will be set to true, which causes the web server to serve things over HTTPS instead of HTTP.

The certificate and key file directives can be set through environment variables (GOBBLE_HTTPS_CERT_FILE and GOBBLE_HTTPS_KEY_FILE) and command-line flags (-https-cert-file and -https-key-file).

When both of these are passed, HTTPS will be enabled.

This also has effect on the default listening address. If not specified, the default listening address will be port 443 on all interfaces if HTTPS is enabled, and port 80 on all interfaces if HTTPS is not enabled.

@evanebb evanebb self-assigned this Sep 9, 2023
@evanebb evanebb added the enhancement New feature or request label Sep 9, 2023
@evanebb evanebb merged commit 22f3933 into main Sep 9, 2023
@evanebb evanebb deleted the feature/https branch September 9, 2023 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add HTTPS support

1 participant