<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # QSslConfiguration Class Reference ## [[QtNetwork](index.htm) module] 該QSslConfiguration類包含一個SSL連接的配置和狀態[More...](#details) ### Methods * `__init__ (self)` * `__init__ (self, QSslConfiguration?other)` * `list-of-QSslCertificate caCertificates (self)` * `list-of-QSslCipher ciphers (self)` * `bool isNull (self)` * `QSslCertificate localCertificate (self)` * `QSslCertificate peerCertificate (self)` * `list-of-QSslCertificate peerCertificateChain (self)` * `int peerVerifyDepth (self)` * `QSslSocket.PeerVerifyMode peerVerifyMode (self)` * `QSslKey privateKey (self)` * `QSsl.SslProtocol protocol (self)` * `QSslCipher sessionCipher (self)` * `setCaCertificates (self, list-of-QSslCertificate?certificates)` * `setCiphers (self, list-of-QSslCipher?ciphers)` * `setLocalCertificate (self, QSslCertificate?certificate)` * `setPeerVerifyDepth (self, int?depth)` * `setPeerVerifyMode (self, QSslSocket.PeerVerifyMode?mode)` * `setPrivateKey (self, QSslKey?key)` * `setProtocol (self, QSsl.SslProtocol?protocol)` * `setSslOption (self, QSsl.SslOption?option, bool?on)` * `bool testSslOption (self, QSsl.SslOption?option)` ### Static Methods * `QSslConfiguration defaultConfiguration ()` * `setDefaultConfiguration (QSslConfiguration?configuration)` ### Special Methods * `bool __eq__ (self, QSslConfiguration?other)` * `bool __ne__ (self, QSslConfiguration?other)` * * * ## Detailed Description 該QSslConfiguration類包含一個SSL連接的配置和狀態 QSslConfiguration是使用Qt的網絡類,轉發一個開放的SSL連接信息,并允許應用程序來控制連接的某些功能。 這QSslConfiguration目前支持的設置是: * The SSL/TLS protocol to be used * The certificate to be presented to the peer during connection and its associated private key * The ciphers allowed to be used for encrypting the connection * The list of Certificate Authorities certificates that are used to validate the peer's certificate 這些設置在連接握手過程僅適用。設置它們的連接已經建立后,沒有任何效果。 該狀態QSslConfiguration支持是: * The certificate the peer presented during handshake, along with the chain leading to a CA certificate * The cipher used to encrypt this session 一旦SSL連接啟動的狀態下才能夠獲得,但不一定之前,它的完成。某些設置可能,而不需要重新啟動它的SSL連接的過程中改變(例如,密碼可以被時間改變了) 。 在QSslConfiguration對象的狀態不能改變。 QSslConfiguration可以被用于[QSslSocket](qsslsocket.html)和網絡訪問的API 。 注意,改變在QSslConfiguration設置是不足以改變在相關的SSL連接的設置。你必須調用修改QSslConfiguration對象setSslConfiguration來實現這個目標。下面的例子演示了如何將協議更改為使用TLSv1在[QSslSocket](qsslsocket.html)對象: ``` QSslConfiguration config = sslSocket.sslConfiguration(); config.setProtocol([QSsl](qssl.html).TlsV1); sslSocket.setSslConfiguration(config); ``` [QSslSocket](qsslsocket.html),[QNetworkAccessManager](qnetworkaccessmanager.html),[QSslSocket.sslConfiguration](qsslsocket.html#sslConfiguration)( )[QSslSocket.setSslConfiguration](qsslsocket.html#setSslConfiguration)( ) * * * ## Method Documentation ``` QSslConfiguration.__init__ (self) ``` 構造一個空的SSL配置。此配置不包含有效的設置和狀態將是空的。[isNull](qsslconfiguration.html#isNull)( )將返回True這個構造函數被調用后。 一旦任何setter方法??被調用時,[isNull](qsslconfiguration.html#isNull)( )將返回False 。 ``` QSslConfiguration.__init__ (self, QSslConfiguration?other) ``` 副本的配置和狀態_other_。如果_other_為null,則該對象將是空過。 ``` list-of-QSslCertificate QSslConfiguration.caCertificates (self) ``` 返回此連接的CA證書數據庫。握手階段中的CA證書數據庫所使用的插座,以驗證對方的證書。它可以與握手之前被修改[setCaCertificates](qsslconfiguration.html#setCaCertificates)() ,或用[QSslSocket](qsslsocket.html)的[addCaCertificate()](qsslsocket.html#addCaCertificate)和[addCaCertificates()](qsslsocket.html#addCaCertificates)。 **See also** [setCaCertificates](qsslconfiguration.html#setCaCertificates)( ) 。 ``` list-of-QSslCipher QSslConfiguration.ciphers (self) ``` 返回此連接的當前密碼的加密套件。在握手階段該列表用于選擇一個會話密碼。密碼返回的列表是按遞減優先級進行排序。 (例如,在列表中的第一密碼是最優選的密碼) 。會話密碼將是第一個在也支持對等的列表。 默認情況下,握手階段可以選擇任何由該系統的SSL庫支持的加密算法,這可能會有所不同從系統到系統。通過此系統的SSL庫支持的密碼列表是由返回[QSslSocket.supportedCiphers](qsslsocket.html#supportedCiphers)( ) 。你可以通過調用限制用于選擇會話密碼為這個套接字密碼列表[setCiphers](qsslconfiguration.html#setCiphers)( )與所支持的加密算法的子集。你可以通過調用恢復使用整套[setCiphers](qsslconfiguration.html#setCiphers)( )與返回列表[QSslSocket.supportedCiphers](qsslsocket.html#supportedCiphers)( ) 。 **See also** [setCiphers](qsslconfiguration.html#setCiphers)()和[QSslSocket.supportedCiphers](qsslsocket.html#supportedCiphers)( ) 。 ``` QSslConfiguration QSslConfiguration.defaultConfiguration () ``` [ 返回新的SSL連接使用的默認SSL配置。 默認的SSL配置包括: * no local certificate and no private key * protocol SecureProtocols (meaning either TLS 1.0 or SSL 3 will be used) * the system's default CA certificate list * the cipher list equal to the list of the SSL libraries' supported SSL ciphers ](qsslconfiguration.html) [**See also**](qsslconfiguration.html) [QSslSocket.supportedCiphers](qsslsocket.html#supportedCiphers)()和[setDefaultConfiguration](qsslconfiguration.html#setDefaultConfiguration)( ) 。 ``` bool QSslConfiguration.isNull (self) ``` 返回True如果這是一個空[QSslConfiguration](qsslconfiguration.html)對象。 A [QSslConfiguration](qsslconfiguration.html)對象為null ,如果它已被缺省構造并沒有setter方法被調用。 **See also** [setProtocol](qsslconfiguration.html#setProtocol)( )[setLocalCertificate](qsslconfiguration.html#setLocalCertificate)( )[setPrivateKey](qsslconfiguration.html#setPrivateKey)( )[setCiphers](qsslconfiguration.html#setCiphers)()和[setCaCertificates](qsslconfiguration.html#setCaCertificates)( ) 。 ``` QSslCertificate QSslConfiguration.localCertificate (self) ``` [ 返回在SSL握手過程中要呈現給同行的證書。 ](qsslcertificate.html) [**See also**](qsslcertificate.html) [setLocalCertificate](qsslconfiguration.html#setLocalCertificate)( ) 。 ``` QSslCertificate QSslConfiguration.peerCertificate (self) ``` [ 返回同行的數字證書(即您已連接到主機的直接證明) ,或空憑證,如果對等未分配證書。 對等證書握手階段中的自動檢查,所以這個功能通常用來獲取用于顯示或連接診斷目的的證書。它包含有關對等的信息,包括它的主機名,證書頒發者,和同行的公鑰。 ](qsslcertificate.html) [因為對等證書握手階段中的設置,它是安全的,從連接到一個插槽存取等證書](qsslcertificate.html)[QSslSocket.sslErrors](qsslsocket.html#sslErrors)( )信號,[QNetworkReply.sslErrors](qnetworkreply.html#sslErrors)()信號,或[QSslSocket.encrypted](qsslsocket.html#encrypted)()信號。 如果證書無效,則返回,它可能意味著SSL握手失敗,或者它可能意味著您已連接到主機沒有證書,或者它可能意味著沒有連接。 如果你想檢查對端的完整的證書鏈,利用[peerCertificateChain](qsslconfiguration.html#peerCertificateChain)()來得到一次全部。 **See also** [peerCertificateChain](qsslconfiguration.html#peerCertificateChain)( )[QSslSocket.sslErrors](qsslsocket.html#sslErrors)( )[QSslSocket.ignoreSslErrors](qsslsocket.html#ignoreSslErrors)( )[QNetworkReply.sslErrors](qnetworkreply.html#sslErrors)()和[QNetworkReply.ignoreSslErrors](qnetworkreply.html#ignoreSslErrors)( ) 。 ``` list-of-QSslCertificate QSslConfiguration.peerCertificateChain (self) ``` 返回數字證書,開始與對端的直接證書,并與CA的證書結束的對等的鏈條。 同行證書握手階段中的自動檢查。此功能通常用于獲取證書顯示,或用于執行連接診斷。證書包含有關對等和證書發行機構,包括主機名,發行人名稱和發行者公開密鑰的信息。 因為對等證書握手階段中的設置,它是安全的,從連接到一個插槽存取等證書[QSslSocket.sslErrors](qsslsocket.html#sslErrors)( )信號,[QNetworkReply.sslErrors](qnetworkreply.html#sslErrors)()信號,或[QSslSocket.encrypted](qsslsocket.html#encrypted)()信號。 如果返回空列表,它可能意味著SSL握手失敗,或者它可能意味著您已連接到主機沒有證書,或者它可能意味著沒有連接。 如果你想只得到了同行的直接證明,使用[peerCertificate](qsslconfiguration.html#peerCertificate)( ) 。 **See also** [peerCertificate](qsslconfiguration.html#peerCertificate)( )[QSslSocket.sslErrors](qsslsocket.html#sslErrors)( )[QSslSocket.ignoreSslErrors](qsslsocket.html#ignoreSslErrors)( )[QNetworkReply.sslErrors](qnetworkreply.html#sslErrors)()和[QNetworkReply.ignoreSslErrors](qnetworkreply.html#ignoreSslErrors)( ) 。 ``` int QSslConfiguration.peerVerifyDepth (self) ``` 返回的證書在同行中的證書鏈,如果沒有最大深度已設置在SSL握手階段,或0 (默認值)要檢查的最大數目,這表明整個證書鏈應該進行檢查。 該證書在發出訂單,開始與對端自己的證書,那么它的頒發者的證書,等檢查。 **See also** [setPeerVerifyDepth](qsslconfiguration.html#setPeerVerifyDepth)()和[peerVerifyMode](qsslconfiguration.html#peerVerifyMode)( ) 。 ``` QSslSocket.PeerVerifyMode QSslConfiguration.peerVerifyMode (self) ``` [](qsslsocket.html#PeerVerifyMode-enum) [返回驗證模式。這種模式決定是否](qsslsocket.html#PeerVerifyMode-enum)[QSslSocket](qsslsocket.html)應要求對等方的證書(即客戶端從服務器請求一個證書,或請求從客戶端證書的服務器) ,以及是否應當要求該證書是有效的。 默認模式是AutoVerifyPeer ,它告訴[QSslSocket](qsslsocket.html)使用VerifyPeer為客戶, QueryPeer的服務器。 **See also** [setPeerVerifyMode](qsslconfiguration.html#setPeerVerifyMode)( ) 。 ``` QSslKey QSslConfiguration.privateKey (self) ``` [](qsslkey.html) [返回](qsslkey.html)[SSL key](qsslkey.html)分配給該連接或null鍵,如果沒有已分配呢。 **See also** [setPrivateKey](qsslconfiguration.html#setPrivateKey)()和[localCertificate](qsslconfiguration.html#localCertificate)( ) 。 ``` QSsl.SslProtocol QSslConfiguration.protocol (self) ``` [ 返回的協議設置為這個SSL配置。 ](qssl.html#SslProtocol-enum) [**See also**](qssl.html#SslProtocol-enum) [setProtocol](qsslconfiguration.html#setProtocol)( ) 。 ``` QSslCipher QSslConfiguration.sessionCipher (self) ``` [](qsslcipher.html) [返回套接字的密碼](qsslcipher.html)[cipher](qsslcipher.html)或空密碼,如果是不加密的連接。套接字的密碼在會議期間握手階段設置。密碼是用于加密和解密通過套接字發送的數據。 在SSL基礎設施還提供了一些函數來設置密碼從中握手階段將最終選擇會話密碼的有序列表。這種有序列表必須到位握手階段開始之前。 **See also** [ciphers](qsslconfiguration.html#ciphers)( )[setCiphers](qsslconfiguration.html#setCiphers)()和[QSslSocket.supportedCiphers](qsslsocket.html#supportedCiphers)( ) 。 ``` QSslConfiguration.setCaCertificates (self, list-of-QSslCertificate?certificates) ``` 設置此套接字的CA證書數據庫是_certificates_。證書數據庫之前必須設置為SSL握手。握手階段中的CA證書數據庫所使用的插座,以驗證對方的證書。 **See also** [caCertificates](qsslconfiguration.html#caCertificates)( ) 。 ``` QSslConfiguration.setCiphers (self, list-of-QSslCipher?ciphers) ``` 加密的加密套件為這個套接字設置為_ciphers_,其中必須包含在由supportedCiphers返回列表中的密碼的一個子集( ) 。 限制密碼套件必須在握手階段,那里的會話密碼被選為前完成。 **See also** [ciphers](qsslconfiguration.html#ciphers)()和[QSslSocket.supportedCiphers](qsslsocket.html#supportedCiphers)( ) 。 ``` QSslConfiguration.setDefaultConfiguration (QSslConfiguration?configuration) ``` 設置要使用的新SSL連接是默認的SSL配置_configuration_。現有的連接不受此調用。 **See also** [QSslSocket.supportedCiphers](qsslsocket.html#supportedCiphers)()和[defaultConfiguration](qsslconfiguration.html#defaultConfiguration)( ) 。 ``` QSslConfiguration.setLocalCertificate (self, QSslCertificate?certificate) ``` 設置SSL握手過程呈現給對端是證書_certificate_。 設置證書一旦連接已建立沒有任何效果。 證書是在SSL的過程中使用的識別手段。本地證書是由遠端驗證本地用戶的身份對認證機構的名單。在大多數情況下,例如在HTTP網頁瀏覽,只能識別服務器到客戶端,所以客戶端沒有發送證書。 **See also** [localCertificate](qsslconfiguration.html#localCertificate)( ) 。 ``` QSslConfiguration.setPeerVerifyDepth (self, int?depth) ``` 設置證書在同行中的證書鏈在SSL握手階段進行檢查的最大數量,以_depth_。設置為0的深度表示沒有最大深度被設定,表明整個證書鏈應進行檢查。 該證書在發出訂單,開始與對端自己的證書,那么它的頒發者的證書,等檢查。 **See also** [peerVerifyDepth](qsslconfiguration.html#peerVerifyDepth)()和[setPeerVerifyMode](qsslconfiguration.html#setPeerVerifyMode)( ) 。 ``` QSslConfiguration.setPeerVerifyMode (self, QSslSocket.PeerVerifyMode?mode) ``` 設置驗證模式_mode_。這種模式決定是否[QSslSocket](qsslsocket.html)應要求對等方的證書(即客戶端從服務器請求一個證書,或請求從客戶端證書的服務器) ,以及是否應當要求該證書是有效的。 默認模式是AutoVerifyPeer ,它告訴[QSslSocket](qsslsocket.html)使用VerifyPeer為客戶, QueryPeer的服務器。 **See also** [peerVerifyMode](qsslconfiguration.html#peerVerifyMode)( ) 。 ``` QSslConfiguration.setPrivateKey (self, QSslKey?key) ``` 設置連接的私人[key](qsslkey.html)至_key_。私鑰和當地[certificate](qsslcertificate.html)所使用的客戶端和服務器必須證明自己身份的SSL同行。 密鑰和本地證書是必需的,如果你正在創建一個SSL服務器套接字。如果要創建一個SSL客戶端套接字,密鑰和本地證書是如果你的客戶端必須確定自己的SSL服務器所需。 **See also** [privateKey](qsslconfiguration.html#privateKey)()和[setLocalCertificate](qsslconfiguration.html#setLocalCertificate)( ) 。 ``` QSslConfiguration.setProtocol (self, QSsl.SslProtocol?protocol) ``` 設置協議設置此配置是_protocol_。 設置協議一旦連接已經建立沒有任何效果。 **See also** [protocol](qsslconfiguration.html#protocol)( ) 。 ``` QSslConfiguration.setSslOption (self, QSsl.SslOption?option, bool?on) ``` 啟用或禁用SSL的兼容性選項。 **See also**testSSlOption ( ) 。 ``` bool QSslConfiguration.testSslOption (self, QSsl.SslOption?option) ``` 如果啟用了指定的SSL兼容性選項,則返回True 。 此功能被引入Qt的4.8 。 **See also**testSSlOption ( ) 。 ``` bool QSslConfiguration.__eq__ (self, QSslConfiguration?other) ``` ``` bool QSslConfiguration.__ne__ (self, QSslConfiguration?other) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看