QHstsPolicy¶

PyQt5.QtNetwork.QHstsPolicy

Description¶

The QHstsPolicy class specifies that a host supports HTTP Strict Transport Security policy (HSTS).

HSTS policy defines a period of time during which QNetworkAccessManager should only access a host in a secure fashion. HSTS policy is defined by RFC6797.

You can set expiry time and host name for this policy, and control whether it applies to subdomains, either in the constructor or by calling setExpiry(), setHost() and setIncludesSubdomains().

Classes¶

PolicyFlags

Enums¶

PolicyFlag

Member

Value

Description

IncludeSubDomains

1

Indicates whether a policy must include subdomains

Methods¶

__init__()

Constructs an invalid (expired) policy with empty host name and subdomains not included.


__init__(QHstsPolicy)

Creates a copy of other object.


__init__(Union[QDateTime, datetime.datetime], Union[PolicyFlags, PolicyFlag], str, mode: ParsingMode = DecodedMode)

Constructs QHstsPolicy with expiry (in UTC); flags is a value indicating whether this policy must also include subdomains, host data is interpreted according to mode.


__eq__(QHstsPolicy) → bool

TODO


expiry() → QDateTime

Returns the expiration date for the policy (in UTC).

See also

setExpiry().


host(options: Union[ComponentFormattingOptions, ComponentFormattingOption] = QUrl.ComponentFormattingOption.FullyDecoded) → str

TODO


includesSubDomains() → bool

Returns true if this policy also includes subdomains.


isExpired() → bool

Return true if this policy has a valid expiration date and this date is greater than QDateTime::currentGetDateTimeUtc().

See also

setExpiry(), expiry().


__ne__(QHstsPolicy) → bool

TODO


setExpiry(Union[QDateTime, datetime.datetime])

Sets the expiration date for the policy (in UTC) to expiry.

See also

expiry().


setHost(str, mode: ParsingMode = DecodedMode)

TODO


setIncludesSubDomains(bool)

Sets whether subdomains are included for this policy to include.


swap(QHstsPolicy)

TODO