跳到主要内容

Security

✅️️ Methods

🔨Security.disable

禁用跟踪安全状态更改。

EN
Disables tracking security state changes.

🔨Security.enable

启用安全状态变化的追踪功能。

EN
Enables tracking security state changes.

🔨Security.setIgnoreCertificateErrors

启用/禁用是否忽略所有证书错误。

EN
Enable/disable whether all certificate errors should be ignored.
参数必填标记类型描述原文
ignore✔️boolean如果为真,将忽略所有证书错误。
ENIf true, all certificate errors will be ignored.

🔨Security.handleCertificateError❌️

处理触发了证书错误事件的证书错误。

EN
Handles a certificate error that fired a certificateError event.
参数必填标记类型描述原文
eventId✔️integer事件ID。
ENThe ID of the event.
action✔️CertificateErrorAction对证书错误采取的操作。
ENThe action to take on the certificate error.

🔨Security.setOverrideCertificateErrors❌️

启用/禁用覆盖证书错误。如果启用,所有证书错误事件都需要由 DevTools 客户端处理,并且应使用 handleCertificateError 命令进行响应。

EN
Enable/disable overriding certificate errors. If enabled, all certificate error events need to be handled by the DevTools client and should be answered with handleCertificateError commands.
参数必填标记类型描述原文
override✔️boolean如果为真,将忽略证书错误。
ENIf true, certificate errors will be overridden.

✅️️ Events

👋Security.certificateError❌️

存在证书错误。如果启用了覆盖证书错误功能,则应使用handleCertificateError命令进行处理。注意:若证书错误已在内部被允许,则不会触发此事件。每个目标同时只应有一个客户端覆盖证书错误。

EN
There is a certificate error. If overriding certificate errors is enabled, then it should be handled with the handleCertificateError command. Note: this event does not fire if the certificate error has been allowed internally. Only one client per target should override certificate errors at the same time.
参数必填标记类型描述原文
eventId✔️integer事件ID。
ENThe ID of the event.
errorType✔️string错误类型。
ENThe type of the error.
requestURL✔️string请求的URL。
ENThe url that was requested.

👋Security.securityStateChanged❌️

页面的安全状态已变更。不再发送。

EN
The security state of the page changed. No longer being sent.
参数必填标记类型描述原文
securityState✔️SecurityState安全状态。
ENSecurity state.
schemeIsCryptographic✔️❌️boolean如果页面是通过加密传输(如HTTPS)加载的,则为真。
ENTrue if the page was loaded over cryptographic transport such as HTTPS.
explanations✔️❌️array[SecurityStateExplanation]之前是一个安全状态解释的列表。现在始终为空。
ENPreviously a list of explanations for the security state. Now always empty.
insecureContentStatus✔️❌️InsecureContentStatus页面不安全内容的相关信息。
ENInformation about insecure content on the page.
summary❌️string覆盖用户可见的状态描述。始终省略。
ENOverrides user-visible description of the state. Always omitted.

👋Security.visibleSecurityStateChanged🧪

页面的安全状态已更改。

EN
The security state of the page changed.
参数必填标记类型描述原文
visibleSecurityState✔️VisibleSecurityState关于页面的安全状态信息。
ENSecurity state information about the page.

✅️️ Types

📌Security.CertificateErrorAction

当发生证书错误时采取的操作。continue 将继续处理请求,而 cancel 将取消请求。
允许的值:continuecancel

EN
The action to take when a certificate error occurs. continue will continue processing the request and cancel will cancel the request.
Allowed Values: continue, cancel

返回类型:string


📌Security.CertificateId

一个内部证书ID值。

EN
An internal certificate ID value.

返回类型:integer


📌Security.MixedContentType

混合内容(HTTPS页面上的HTTP资源)的描述,定义参见https://www.w3.org/TR/mixed-content/#categories
允许取值:blockable, optionally-blockable, none

EN
A description of mixed content (HTTP resources on HTTPS pages), as defined by https://www.w3.org/TR/mixed-content/#categories
Allowed Values: blockable, optionally-blockable, none

返回类型:string


📌Security.SecurityState

页面或资源的安全等级。
允许的取值:unknownneutralinsecuresecureinfoinsecure-broken

EN
The security level of a page or resource.
Allowed Values: unknown, neutral, insecure, secure, info, insecure-broken

返回类型:string


📌Security.SecurityStateExplanation

对影响安全状态的一个因素的解释。

EN
An explanation of an factor contributing to the security state.

返回类型:object

属性必填标记类型描述原文
securityState✔️SecurityState安全状态,表示所解释因素的严重程度。
ENSecurity state representing the severity of the factor being explained.
title✔️string描述因素类型的标题。
ENTitle describing the type of factor.
summary✔️string简短描述因素类型的短语。
ENShort phrase describing the type of factor.
description✔️string因素全文解释。
ENFull text explanation of the factor.
mixedContentType✔️MixedContentType解释所描述的混合内容类型。
ENThe type of mixed content described by the explanation.
certificate✔️array[string]页面证书。
ENPage certificate.
recommendationsarray[string]修复任何问题的建议。
ENRecommendations to fix any issues.

📌Security.InsecureContentStatus❌️

页面不安全内容的相关信息。

EN
Information about insecure content on the page.

返回类型:object

属性必填标记类型描述原文
ranMixedContent✔️boolean总是为假。
ENAlways false.
displayedMixedContent✔️boolean始终为假。
ENAlways false.
containedMixedForm✔️boolean总是为假。
ENAlways false.
ranContentWithCertErrors✔️boolean始终为假。
ENAlways false.
displayedContentWithCertErrors✔️boolean始终为假。
ENAlways false.
ranInsecureContentStyle✔️SecurityState始终设置为unknown。
ENAlways set to unknown.
displayedInsecureContentStyle✔️SecurityState始终设置为 unknown。
ENAlways set to unknown.

📌Security.CertificateSecurityState🧪

关于页面证书安全状态的详细信息。

EN
Details about the security state of the page certificate.

返回类型:object

属性必填标记类型描述原文
protocol✔️string协议名称(例如 "TLS 1.2" 或 "QUIC")。
ENProtocol name (e.g. "TLS 1.2" or "QUIC").
keyExchange✔️string连接所使用的密钥交换方式,如果不适用则为空字符串。
ENKey Exchange used by the connection, or the empty string if not applicable.
keyExchangeGroupstring连接所使用的(EC)DH群组,如适用。
EN(EC)DH group used by the connection, if applicable.
cipher✔️string密码名称。
ENCipher name.
macstringTLS MAC。请注意,AEAD 密码没有单独的 MAC。
ENTLS MAC. Note that AEAD ciphers do not have separate MACs.
certificate✔️array[string]页面证书。
ENPage certificate.
subjectName✔️string证书主题名称。
ENCertificate subject name.
issuer✔️string颁发证书的CA名称。
ENName of the issuing CA.
validFrom✔️Network.TimeSinceEpoch证书有效起始日期。
ENCertificate valid from date.
validTo✔️Network.TimeSinceEpoch证书有效期至(到期)日期
ENCertificate valid to (expiration) date
certificateNetworkErrorstring最高优先级的网络错误代码,如果证书存在错误。
ENThe highest priority network error code, if the certificate has an error.
certificateHasWeakSignature✔️boolean如果证书使用了弱签名算法,则为真。
ENTrue if the certificate uses a weak signature algorithm.
certificateHasSha1Signature✔️boolean如果证书链中存在 SHA1 签名,则为真。
ENTrue if the certificate has a SHA1 signature in the chain.
modernSSL✔️boolean如果为现代 SSL
ENTrue if modern SSL
obsoleteSslProtocol✔️boolean如果连接使用的是过时的SSL协议,则为真。
ENTrue if the connection is using an obsolete SSL protocol.
obsoleteSslKeyExchange✔️boolean如果连接使用的是过时的SSL密钥交换,则为真。
ENTrue if the connection is using an obsolete SSL key exchange.
obsoleteSslCipher✔️boolean如果连接使用的是过时的SSL密码,则为真。
ENTrue if the connection is using an obsolete SSL cipher.
obsoleteSslSignature✔️boolean如果连接使用的是过时的SSL签名,则为真。
ENTrue if the connection is using an obsolete SSL signature.

📌Security.SafetyTipInfo🧪

返回类型:object

属性必填标记类型描述原文
safetyTipStatus✔️SafetyTipStatus描述页面是否触发任何安全提示或信誉警告。默认值为未知。
ENDescribes whether the page triggers any safety tips or reputation warnings. Default is unknown.
safeUrlstring安全提示建议的URL("您是否意指?")。仅针对相似匹配项填写。
ENThe URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches.

📌Security.SafetyTipStatus🧪

允许的值:badReputationlookalike

EN
Allowed Values: badReputation, lookalike

返回类型:string


📌Security.VisibleSecurityState🧪

关于页面的安全状态信息。

EN
Security state information about the page.

返回类型:object

属性必填标记类型描述原文
securityState✔️SecurityState页面的安全级别。
ENThe security level of the page.
certificateSecurityStateCertificateSecurityState页面证书的安全状态详情。
ENSecurity state details about the page certificate.
safetyTipInfoSafetyTipInfo页面触发的安全提示类型。请注意,即使安全提示界面并未实际显示,此字段也会被设置。
ENThe type of Safety Tip triggered on the page. Note that this field will be set even if the Safety Tip UI was not actually shown.
securityStateIssueIds✔️array[string]安全状态问题ID的数组。
ENArray of security state issues ids.