mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-11-21 19:26:40 +00:00
When creating a Proxy Host, Redirection Host, or 404 Host and requesting
a brand new Let's Encrypt certificate in the same submission, the
ssl_forced/http2_support/hsts_enabled/hsts_subdomains fields the user
enabled on the form were silently discarded and saved as false.
Root cause: certificate_id is deleted from the payload before the
initial insert (since "new" is not a real certificate id yet), so
cleanSslHstsData() sees no certificate_id and zeroes the SSL toggles
under its "no cert means SSL can't be forced" invariant - even though
a certificate is about to be created moments later in the same
request. The follow-up update() call that attaches the freshly
created certificate_id only passed { id, certificate_id }, so the
user's original toggle values were never re-applied.
Fix: skip the premature cleanSslHstsData() zeroing during the initial
insert when a certificate is being created, and forward the originally
submitted ssl_forced/http2_support/hsts_enabled/hsts_subdomains values
in the follow-up update() call, once the real certificate exists to
validate them against.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>