Class HSTSEnforcer

java.lang.Object
All Implemented Interfaces:
Proxy, SessionFeature
Direct Known Subclasses:
HSTSEnforcerDB

@Generated("io.github.jwharm.JavaGI") public class HSTSEnforcer extends GObject implements SessionFeature
Automatic HTTP Strict Transport Security enforcing for Session.

A SoupHSTSEnforcer stores HSTS policies and enforces them when required. SoupHSTSEnforcer implements SessionFeature, so you can add an HSTS enforcer to a session with Session.addFeature(org.gnome.soup.SessionFeature) or Session.addFeatureByType(org.gnome.glib.Type).

SoupHSTSEnforcer keeps track of all the HTTPS destinations that, when connected to, return the Strict-Transport-Security header with valid values. SoupHSTSEnforcer will forget those destinations upon expiry or when the server requests it.

When the Session the SoupHSTSEnforcer is attached to queues or restarts a message, the SoupHSTSEnforcer will rewrite the URI to HTTPS if the destination is a known HSTS host and is contacted over an insecure transport protocol (HTTP). Users of SoupHSTSEnforcer are advised to listen to changes in the Message:uri property in order to be aware of changes in the message URI.

Note that SoupHSTSEnforcer does not support any form of long-term HSTS policy persistence. See HSTSEnforcerDB for a persistent enforcer.