@@ -307,9 +307,9 @@ msgid ""
307
307
msgstr ""
308
308
"如果你發現某些舊的客戶端或伺服器常適用此函式建立的 :class:`SSLContext` 連線"
309
309
"時,收到 \" Protocol or cipher suite mismatch\" 錯誤,這可能是因為他們的系統僅"
310
- "支援 SSL3.0,然而 SSL3.0 已被此函數用 :data:`OP_NO_SSLv3` 排除。目前廣泛認為 "
310
+ "支援 SSL3.0,然而 SSL3.0 已被此函式用 :data:`OP_NO_SSLv3` 排除。目前廣泛認為 "
311
311
"SSL3.0 已經\\ `被完全破解 <https://en.wikipedia.org/wiki/POODLE>`_。如果你仍"
312
- "然希望在允許 SSL3.0 連線的情況下使用此函數 ,可以使用下面的方法: ::"
312
+ "然希望在允許 SSL3.0 連線的情況下使用此函式 ,可以使用下面的方法: ::"
313
313
314
314
#: ../../library/ssl.rst:170
315
315
msgid ""
@@ -1587,29 +1587,38 @@ msgid ""
1587
1587
"active SSL connection, i.e. the handshake was completed and :meth:`SSLSocket."
1588
1588
"unwrap` was not called."
1589
1589
msgstr ""
1590
+ ":meth:`~SSLSocket.read` 和 :meth:`~SSLSocket.write` 方法為低階層的方法,負責"
1591
+ "讀取和寫入未加密的應用層資料,並將其加密/解密為加密的寫入層資料。這些方法需要"
1592
+ "一個已建立的 SSL 連接,即握手已完成,且未呼叫 :meth:`SSLSocket.unwrap`。"
1590
1593
1591
1594
#: ../../library/ssl.rst:1123
1592
1595
msgid ""
1593
1596
"Normally you should use the socket API methods like :meth:`~socket.socket."
1594
1597
"recv` and :meth:`~socket.socket.send` instead of these methods."
1595
1598
msgstr ""
1599
+ "通常你應該使用像 :meth:`~socket.socket.recv` 和 :meth:`~socket.socket.send` "
1600
+ "這樣的 socket API 方法,而不是直接使用這些方法。"
1596
1601
1597
1602
#: ../../library/ssl.rst:1129
1598
1603
msgid "Perform the SSL setup handshake."
1599
- msgstr ""
1604
+ msgstr "執行 SSL 設定握手。 "
1600
1605
1601
1606
#: ../../library/ssl.rst:1131
1602
1607
msgid ""
1603
1608
"The handshake method also performs :func:`match_hostname` when the :attr:"
1604
1609
"`~SSLContext.check_hostname` attribute of the socket's :attr:`~SSLSocket."
1605
1610
"context` is true."
1606
1611
msgstr ""
1612
+ "當 socket 的 :attr:`~SSLSocket.context` 的 :attr:`~SSLContext."
1613
+ "check_hostname` 屬性質為 true 時,握手方法也會執行 :func:`match_hostname`。"
1607
1614
1608
1615
#: ../../library/ssl.rst:1136
1609
1616
msgid ""
1610
1617
"The socket timeout is no longer reset each time bytes are received or sent. "
1611
1618
"The socket timeout is now the maximum total duration of the handshake."
1612
1619
msgstr ""
1620
+ "Socket 超時時間已經不會在每次接收或傳送位元組時重置。現在,超時時間是握手過程"
1621
+ "的最大總持續時間。"
1613
1622
1614
1623
#: ../../library/ssl.rst:1140
1615
1624
msgid ""
@@ -1618,13 +1627,18 @@ msgid ""
1618
1627
"or IP address, the handshake is aborted early and a TLS alert message is "
1619
1628
"sent to the peer."
1620
1629
msgstr ""
1630
+ "在握手過程中,OpenSSL 會去配對主機名稱或 IP 地址。已不再使用 :func:"
1631
+ "`match_hostname` 函式。如果 OpenSSL 拒絕某個主機名稱或 IP 地址,握手將會提前"
1632
+ "中止,並向對方發送 TLS 警報訊息。"
1621
1633
1622
1634
#: ../../library/ssl.rst:1148
1623
1635
msgid ""
1624
1636
"If there is no certificate for the peer on the other end of the connection, "
1625
1637
"return ``None``. If the SSL handshake hasn't been done yet, raise :exc:"
1626
1638
"`ValueError`."
1627
1639
msgstr ""
1640
+ "如果連線端沒有證書,則回傳 ``None``。如果 SSL 握手尚未完成,則引發 :exc:"
1641
+ "`ValueError`。"
1628
1642
1629
1643
#: ../../library/ssl.rst:1152
1630
1644
msgid ""
@@ -1637,6 +1651,11 @@ msgid ""
1637
1651
"of the *Subject Alternative Name* extension (see :rfc:`3280`), there will "
1638
1652
"also be a ``subjectAltName`` key in the dictionary."
1639
1653
msgstr ""
1654
+ "如果 ``binary_form`` 參數為 :const:`False`,且從對等 (peer) 接收到證書,則該"
1655
+ "方法回傳一個 :class:`dict` 實例。如果證書未被驗證,則該字典為空。若證書已被驗"
1656
+ "證,則回傳的字典將包含數個鍵值,包括 ``subject`` (證書所簽發的對象) 和 "
1657
+ "``issuer`` (簽發證書的主體)。如果證書中包含 *Subject Alternative Name* 擴充 "
1658
+ "(參考\\ :rfc:`3280`\\ ),字典中還會有一個 ``subjectAltName`` 鍵。"
1640
1659
1641
1660
#: ../../library/ssl.rst:1161
1642
1661
msgid ""
@@ -1645,6 +1664,9 @@ msgid ""
1645
1664
"structure for the respective fields, and each RDN is a sequence of name-"
1646
1665
"value pairs. Here is a real-world example::"
1647
1666
msgstr ""
1667
+ "``subject`` 和 ``issuer`` 欄位欄位是包含相對識別名稱 (relative distinguished "
1668
+ "names, RDNs) 序列的元組,這些 RDN 來自證書資料結構中的相應欄位。每個 RDN 都是"
1669
+ "一組名稱與值的對。以下是現實中的範例: ::"
1648
1670
1649
1671
#: ../../library/ssl.rst:1166
1650
1672
msgid ""
@@ -1696,12 +1718,15 @@ msgid ""
1696
1718
"certificate. Whether the peer provides a certificate depends on the SSL "
1697
1719
"socket's role:"
1698
1720
msgstr ""
1721
+ "如果 ``binary_form`` 參數設定為 :const:`True`,且對等提供了證書,則該方法會"
1722
+ "以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對等未提供證書,則回傳:"
1723
+ "const:`None`。對等是否提供證書取決於 SSL socket 的腳色:"
1699
1724
1700
1725
#: ../../library/ssl.rst:1191
1701
1726
msgid ""
1702
1727
"for a client SSL socket, the server will always provide a certificate, "
1703
1728
"regardless of whether validation was required;"
1704
- msgstr ""
1729
+ msgstr "對於客戶端 SSL socket,伺服器將永遠提供證書,無論是否需要進行驗證; "
1705
1730
1706
1731
#: ../../library/ssl.rst:1194
1707
1732
msgid ""
@@ -1710,6 +1735,9 @@ msgid ""
1710
1735
"`None` if you used :const:`CERT_NONE` (rather than :const:`CERT_OPTIONAL` "
1711
1736
"or :const:`CERT_REQUIRED`)."
1712
1737
msgstr ""
1738
+ "對於伺服器 SSL socket,客戶端僅在伺服器要求時才會提供證書;因此,如果你使用的"
1739
+ "是 :const:`CERT_NONE` (而非 :const:`CERT_OPTIONAL` 或 :const:"
1740
+ "`CERT_REQUIRED`),則 :meth:`getpeercert` 會回傳 :const:`None`。"
1713
1741
1714
1742
#: ../../library/ssl.rst:1199
1715
1743
msgid "See also :attr:`SSLContext.check_hostname`."
0 commit comments