QHstsPolicy#

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

Synopsis#

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

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() .

class PySide6.QtNetwork.QHstsPolicy#

PySide6.QtNetwork.QHstsPolicy(expiry, flags, host[, mode=QUrl.DecodedMode])

PySide6.QtNetwork.QHstsPolicy(rhs)

Parameters:

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

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.

See also

PolicyFlag

Creates a copy of other object.

PySide6.QtNetwork.QHstsPolicy.PolicyFlag#

Constant

Description

QHstsPolicy.IncludeSubDomains

(inherits enum.Flag) Indicates whether a policy must include subdomains

PySide6.QtNetwork.QHstsPolicy.expiry()#
Return type:

PySide6.QtCore.QDateTime

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

See also

setExpiry()

PySide6.QtNetwork.QHstsPolicy.host([options=QUrl.FullyDecoded])#
Parameters:

options – Combination of QUrl.ComponentFormattingOption

Return type:

str

Returns a host for a given policy, formatted according to options.

See also

setHost() ComponentFormattingOptions

PySide6.QtNetwork.QHstsPolicy.includesSubDomains()#
Return type:

bool

Returns true if this policy also includes subdomains.

PySide6.QtNetwork.QHstsPolicy.isExpired()#
Return type:

bool

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

PySide6.QtNetwork.QHstsPolicy.__ne__(rhs)#
Parameters:

rhsPySide6.QtNetwork.QHstsPolicy

Return type:

bool

Returns true if the two policies lhs and rhs do not have the same host or expiration date, or do not agree on whether to include or exclude subdomains.

PySide6.QtNetwork.QHstsPolicy.__eq__(rhs)#
Parameters:

rhsPySide6.QtNetwork.QHstsPolicy

Return type:

bool

Returns true if the two policies lhs and rhs have the same host and expiration date while agreeing on whether to include or exclude subdomains.

PySide6.QtNetwork.QHstsPolicy.setExpiry(expiry)#
Parameters:

expiryPySide6.QtCore.QDateTime

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

See also

expiry()

PySide6.QtNetwork.QHstsPolicy.setHost(host[, mode=QUrl.DecodedMode])#
Parameters:

Sets a host, host data is interpreted according to mode parameter.

See also

host() ParsingMode

PySide6.QtNetwork.QHstsPolicy.setIncludesSubDomains(include)#
Parameters:

include – bool

Sets whether subdomains are included for this policy to include.

PySide6.QtNetwork.QHstsPolicy.swap(other)#
Parameters:

otherPySide6.QtNetwork.QHstsPolicy

Swaps this policy with the other policy.