Updated STS upgrade handling to fall back to the current connection port when servers omit a port in the STS capability, enabling TLS upgrades for non-TLS connections in that case.

This commit is contained in:
2026-01-25 18:26:20 -07:00
parent a0f0c48bc5
commit bc1d2e5f7a

View File

@@ -552,9 +552,17 @@ sts_handle_capability (struct server *serv, const char *value)
if (!serv->use_ssl) if (!serv->use_ssl)
{ {
if (!has_port) if (!has_port)
{
if (serv->port > 0)
{
port = (guint16) serv->port;
has_port = TRUE;
}
else
{ {
return FALSE; return FALSE;
} }
}
#ifdef USE_OPENSSL #ifdef USE_OPENSSL
if (serv->sts_upgrade_in_progress) if (serv->sts_upgrade_in_progress)
{ {