Skip to content

HTTP.sys HTTPS binding validation only checks IP:port bindings, so a server with SNI-only bindings on 443 cannot start #208

Description

@Stemonik

Summary

With UseHttps, TDextHttpSysEngine.Start first validates the certificate binding (RegisterSslBinding). The validation only looks at IP:port bindings. When port 443 has only hostname (SNI) or central-store bindings, it raises and the service doesn't start, even though HTTP.sys would serve HTTPS for that prefix.

Where

Sources/Server/Dext.Server.HttpSys.pas, TDextHttpSysEngine.RegisterSslBinding. It queries HttpServiceConfigSslCertInfo with HttpServiceConfigQueryExact on 0.0.0.0:<port> (or the configured IPv4 address), and on ERROR_FILE_NOT_FOUND raises:

No http.sys SSL binding exists for +:443. Inspect or provision it with: netsh http show sslcert ipport=+:443

It never checks either of the other two binding kinds:

  • HttpServiceConfigSslSniCertInfo: hostname bindings. IIS creates these for every site with "Require Server Name Indication", and win-acme creates them when it installs a certificate for such a site;
  • HttpServiceConfigSslCcsCertInfo: central certificate store bindings.

Why it matters

Running a Dext service on HTTP.sys next to IIS on the same 443 is a natural deployment: HTTP.sys routes by URL prefix, and the service reuses the certificate IIS/win-acme already manage and renew. Where those bindings are all per-hostname, the service can't start.

To be transparent: we found this reading the code while deploying to such a server, not by watching it fail. Our server also has a 0.0.0.0:443 binding, so it starts fine.

Suggested fix (either, or both)

  • (a) When the IP:port lookup returns ERROR_FILE_NOT_FOUND, look for an SNI binding for the host in the URL prefix (and a CCS binding for the port) before raising.
  • (b) An option to skip the check (e.g. ValidateSslBinding, default True), for setups where bindings are managed outside the service.

A small related one: with the address +, the message suggests netsh http show sslcert ipport=+:443, which netsh rejects. The query itself uses 0.0.0.0, so the message could print that.

Checked against f440e79a.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions