Repository navigation
Conversation
The HTTPS connector was always created, so a deployment that ends TLS at a proxy or load balancer still opened the SSL port with a self-signed certificate. LRSQL_ENABLE_HTTPS (enableHttps), default true, leaves the current behavior unchanged; with false, no SSL connector or HTTP/2 over TLS is configured. The webserver spec refuses a configuration with both HTTP and HTTPS disabled, and the startup log line says when HTTPS is off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
lrsql.system.webserver/service-mappasses:ssl? trueto Jetty unconditionally, so SQL LRS always opens the SSL port (LRSQL_SSL_PORT, default 8443). When TLS ends at a proxy or load balancer, that is a second, unused listener, usually with a generated self-signed certificate.LRSQL_ENABLE_HTTP=falsealready gives an HTTPS-only server. There is no matching way to get an HTTP-only one; #242 asked for this, and the answer was to ignore the port.Fix
LRSQL_ENABLE_HTTPS(enableHttps), defaulttrue. Withtrue, nothing changes. Withfalse,:ssl?is false,:ssl-portis nil and:h2?is false. Pedestal creates the SSL connector when any of those three is set, so all three are gated. HTTP/2 cleartext (h2c) on the HTTP port still followsLRSQL_ENABLE_HTTP2.enable-httpandenable-httpsfalse, rather than starting a server with no listener.Starting new webserver at host … and HTTP port … (HTTPS disabled)instead of printing a nil SSL port.enable-httpsis optional in the spec (absent meanstrue) and present in both defaultwebserver.ednfiles.The keystore is still loaded or generated as before, because its private key signs admin tokens unless
LRSQL_JWT_COMMON_SECRETis set.Tests
lrsql.https-disabled-test/https-disabled-teststarts a system with[:webserver :enable-https] false. It checks that/healthanswers 200 on HTTP, that a connection to 8443 is refused (curl exit 7), and that the service map has no SSL connector options.lrsql.util.https-setting-test/https-setting-config-testchecks the spec: the default with the key absent, HTTP only, HTTPS only, both off refused, and a non-boolean refused. It is a separate namespace without the database fixture, because that fixture truncates tables a pure spec test never creates.main(587f7995) with only the tests addedhttps-disabled-test, SQLitehttps-setting-config-testTest runs
mainfor comparisonThe existing
lrsql.https-test(HTTPS on by default) passes unchanged. clj-kondo 2025.10.23: 0 errors, 0 warnings.Documentation
doc/env_vars.md: a newLRSQL_ENABLE_HTTPSrow. TheLRSQL_ENABLE_HTTProw no longer says HTTPS "is always enabled".doc/https.md: how to serve HTTP only behind a TLS-terminating proxy, and the note about the keystore.Upgrade notes
enableHttp: falsekeeps working. Only the new combination of both false is refused, at startup.https://…:<sslPort>entries when HTTPS is off. They are harmless, andLRSQL_ALLOWED_ORIGINSoverrides them as before.Other pull requests touching the same files
src/main/lrsql/system/webserver.cljis also edited by "Send the configured security headers on every response", "Log authentication events" and "Add a token ID to admin JWTs…". The changes are in different places and merge cleanly with each of them; this was checked by merging all of them together.doc/env_vars.mdis also edited by the security-header, token and authentication-logging pull requests, in other sections.🤖 Generated with Claude Code