Updated STS policy handling to require an active connection port when already on TLS, ignoring any advertised port token before storing the profile.

This commit is contained in:
2026-02-04 10:30:13 -07:00
parent 89a8f3eb0a
commit b09e6a5405

View File

@@ -593,14 +593,15 @@ sts_handle_capability (struct server *serv, const char *value)
{
time_t now = time (NULL);
time_t expires_at = now + (time_t) duration;
guint16 effective_port = serv->port > 0 ? (guint16) serv->port : port;
guint16 effective_port = 0;
sts_profile *profile;
if (effective_port == 0)
if (serv->port <= 0)
{
return FALSE;
}
effective_port = (guint16) serv->port;
profile = sts_profile_new (hostname, effective_port, expires_at, duration,
has_preload ? preload : FALSE);
sts_profile_store (profile);