From d4192a4e216abb23d708521ff9665b039a5e3545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E5=AE=87=E4=BC=B8?= Date: Sun, 8 Sep 2024 22:30:51 +0800 Subject: [PATCH 1/7] Work on ssl --- library/ssl.po | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/library/ssl.po b/library/ssl.po index 4e64079545..397ce2f3a4 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-08-04 00:03+0000\n" -"PO-Revision-Date: 2024-08-28 00:43+0800\n" +"PO-Revision-Date: 2024-09-08 22:30+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1471,16 +1471,21 @@ msgid "" "active SSL connection, i.e. the handshake was completed and :meth:`SSLSocket." "unwrap` was not called." msgstr "" +":meth:`~SSLSocket.read` 和 :meth:`~SSLSocket.write` 方法為低階的方法,負責讀" +"取和寫入未加密的應用數據,並將其加密/解密為加密的寫入數據。這些方法需要一個已" +"建立的 SSL 連接,即握手已完成,且未呼叫 :meth:`SSLSocket.unwrap`。" #: ../../library/ssl.rst:1123 msgid "" "Normally you should use the socket API methods like :meth:`~socket.socket." "recv` and :meth:`~socket.socket.send` instead of these methods." msgstr "" +"通常你應該使用像 :meth:`~socket.socket.recv` 和 :meth:`~socket.socket.send` " +"這樣的 socket API 方法,而不是直接使用這些方法。" #: ../../library/ssl.rst:1129 msgid "Perform the SSL setup handshake." -msgstr "" +msgstr "執行 SSL 設定握手。" #: ../../library/ssl.rst:1131 msgid "" @@ -1488,12 +1493,16 @@ msgid "" "`~SSLContext.check_hostname` attribute of the socket's :attr:`~SSLSocket." "context` is true." msgstr "" +"當 socket 的 :attr:`~SSLSocket.context` 的 :attr:`~SSLContext." +"check_hostname` 屬性質為 true 時,握手方法也會執行 :func:`match_hostname`。" #: ../../library/ssl.rst:1136 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration of the handshake." msgstr "" +"Socket 超時時間已經不會在每次接收或傳送位元組時重置。現在,超時時間是握手過程" +"的最大總持續時間。" #: ../../library/ssl.rst:1140 msgid "" @@ -1502,6 +1511,9 @@ msgid "" "or IP address, the handshake is aborted early and a TLS alert message is " "sent to the peer." msgstr "" +"在握手過程中,OpenSSL 會去配對主機名稱或 IP 地址。已不再使用 :func:" +"`match_hostname` 函數。如果 OpenSSL 拒絕某個主機名稱或 IP 地址,握手將會提前" +"中止,並向對方發送 TLS 警報訊息。" #: ../../library/ssl.rst:1148 msgid "" @@ -1509,6 +1521,8 @@ msgid "" "return ``None``. If the SSL handshake hasn't been done yet, raise :exc:" "`ValueError`." msgstr "" +"如果連線端沒有證書,則返回 ``None``。如果 SSL 握手尚未完成,則引發 :exc:" +"`ValueError`。" #: ../../library/ssl.rst:1152 msgid "" @@ -1521,6 +1535,11 @@ msgid "" "of the *Subject Alternative Name* extension (see :rfc:`3280`), there will " "also be a ``subjectAltName`` key in the dictionary." msgstr "" +"如果 ``binary_form`` 參數為 :const:`False`,且從對端接收到證書,則該方法返回" +"一個 :class:`dict` 實例。如果證書未被驗證,則該字典為空。若證書已被驗證,則返" +"回的字典將包含數個鍵值,包括 ``subject`` (證書所簽發的對象) 和 ``issuer`` (簽" +"發證書的主體)。如果證書中包含 *Subject Alternative Name* 擴充 (參考\\ :rfc:" +"`3280`\\ ),字典中還會有一個 ``subjectAltName`` 鍵。" #: ../../library/ssl.rst:1161 msgid "" @@ -1529,6 +1548,9 @@ msgid "" "structure for the respective fields, and each RDN is a sequence of name-" "value pairs. Here is a real-world example::" msgstr "" +"``subject`` 和 ``issuer`` 欄位欄位是包含相對識別名稱 (relative distinguished " +"names, RDNs) 序列的元組,這些 RDN 來自證書資料結構中的相應欄位。每個 RDN 都是" +"一組名稱與值的對。以下是現實中的範例::" #: ../../library/ssl.rst:1185 msgid "" @@ -1538,12 +1560,15 @@ msgid "" "certificate. Whether the peer provides a certificate depends on the SSL " "socket's role:" msgstr "" +"如果 ``binary_form`` 參數設定為 :const:`True`,且對端提供了證書,則該方法會" +"以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對端未提供證書,則返回 :" +"const:`None`。對端是否提供證書取決於 SSL socket 的腳色。" #: ../../library/ssl.rst:1191 msgid "" "for a client SSL socket, the server will always provide a certificate, " "regardless of whether validation was required;" -msgstr "" +msgstr "對於客戶端 SSL socket,伺服器將永遠提供證書,無論是否需要進行驗證。" #: ../../library/ssl.rst:1194 msgid "" @@ -1552,6 +1577,9 @@ msgid "" "`None` if you used :const:`CERT_NONE` (rather than :const:`CERT_OPTIONAL` " "or :const:`CERT_REQUIRED`)." msgstr "" +"對於伺服器 SSL socket,客戶端僅在伺服器要求時才會提供證書;因此,如果你使用的" +"是 :const:`CERT_NONE` (而非 :const:`CERT_OPTIONAL` 或 :const:" +"`CERT_REQUIRED`),則 :meth:`getpeercert` 會回傳 :const:`None`。" #: ../../library/ssl.rst:1199 msgid "See also :attr:`SSLContext.check_hostname`." From d44a0b2a8368af5238998b9bb9f008e98e35c1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E5=AE=87=E4=BC=B8?= Date: Wed, 11 Sep 2024 00:46:24 +0800 Subject: [PATCH 2/7] Apply suggestion --- library/ssl.po | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/library/ssl.po b/library/ssl.po index 397ce2f3a4..f2bd711db7 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-08-04 00:03+0000\n" -"PO-Revision-Date: 2024-09-08 22:30+0800\n" +"PO-Revision-Date: 2024-09-11 00:48+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -251,9 +251,9 @@ msgid "" msgstr "" "如果你發現某些舊的客戶端或伺服器常適用此函式建立的 :class:`SSLContext` 連線" "時,收到 \"Protocol or cipher suite mismatch\" 錯誤,這可能是因為他們的系統僅" -"支援 SSL3.0,然而 SSL3.0 已被此函數用 :data:`OP_NO_SSLv3` 排除。目前廣泛認為 " +"支援 SSL3.0,然而 SSL3.0 已被此函式用 :data:`OP_NO_SSLv3` 排除。目前廣泛認為 " "SSL3.0 已經\\ `被完全破解 `_。如果你仍" -"然希望在允許 SSL3.0 連線的情況下使用此函數,可以使用下面的方法: ::" +"然希望在允許 SSL3.0 連線的情況下使用此函式,可以使用下面的方法: ::" #: ../../library/ssl.rst:177 msgid "RC4 was dropped from the default cipher string." @@ -1471,9 +1471,9 @@ msgid "" "active SSL connection, i.e. the handshake was completed and :meth:`SSLSocket." "unwrap` was not called." msgstr "" -":meth:`~SSLSocket.read` 和 :meth:`~SSLSocket.write` 方法為低階的方法,負責讀" -"取和寫入未加密的應用數據,並將其加密/解密為加密的寫入數據。這些方法需要一個已" -"建立的 SSL 連接,即握手已完成,且未呼叫 :meth:`SSLSocket.unwrap`。" +":meth:`~SSLSocket.read` 和 :meth:`~SSLSocket.write` 方法為低階層的方法,負責" +"讀取和寫入未加密的應用層資料,並將其加密/解密為加密的寫入層資料。這些方法需要" +"一個已建立的 SSL 連接,即握手已完成,且未呼叫 :meth:`SSLSocket.unwrap`。" #: ../../library/ssl.rst:1123 msgid "" @@ -1521,7 +1521,7 @@ msgid "" "return ``None``. If the SSL handshake hasn't been done yet, raise :exc:" "`ValueError`." msgstr "" -"如果連線端沒有證書,則返回 ``None``。如果 SSL 握手尚未完成,則引發 :exc:" +"如果連線端沒有證書,則回傳 ``None``。如果 SSL 握手尚未完成,則引發 :exc:" "`ValueError`。" #: ../../library/ssl.rst:1152 @@ -1535,7 +1535,7 @@ msgid "" "of the *Subject Alternative Name* extension (see :rfc:`3280`), there will " "also be a ``subjectAltName`` key in the dictionary." msgstr "" -"如果 ``binary_form`` 參數為 :const:`False`,且從對端接收到證書,則該方法返回" +"如果 ``binary_form`` 參數為 :const:`False`,且從對端接收到證書,則該方法回傳" "一個 :class:`dict` 實例。如果證書未被驗證,則該字典為空。若證書已被驗證,則返" "回的字典將包含數個鍵值,包括 ``subject`` (證書所簽發的對象) 和 ``issuer`` (簽" "發證書的主體)。如果證書中包含 *Subject Alternative Name* 擴充 (參考\\ :rfc:" @@ -1561,8 +1561,8 @@ msgid "" "socket's role:" msgstr "" "如果 ``binary_form`` 參數設定為 :const:`True`,且對端提供了證書,則該方法會" -"以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對端未提供證書,則返回 :" -"const:`None`。對端是否提供證書取決於 SSL socket 的腳色。" +"以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對端未提供證書,則回傳 :" +"const:`None`。對端是否提供證書取決於 SSL socket 的腳色:" #: ../../library/ssl.rst:1191 msgid "" From 7fea1dc1bc72f3ec6bea39804769c9460e332e6e Mon Sep 17 00:00:00 2001 From: timmy0123 <48618505+timmy0123@users.noreply.github.com> Date: Wed, 11 Sep 2024 00:57:39 +0800 Subject: [PATCH 3/7] Apply suggestions from code review Co-authored-by: Wei-Hsiang (Matt) Wang --- library/ssl.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl.po b/library/ssl.po index f2bd711db7..7bf98b335c 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -1550,7 +1550,7 @@ msgid "" msgstr "" "``subject`` 和 ``issuer`` 欄位欄位是包含相對識別名稱 (relative distinguished " "names, RDNs) 序列的元組,這些 RDN 來自證書資料結構中的相應欄位。每個 RDN 都是" -"一組名稱與值的對。以下是現實中的範例::" +"一組名稱與值的對。以下是現實中的範例: ::" #: ../../library/ssl.rst:1185 msgid "" From 158bad5cca1ccc7ed5e343883d671ab56fc4a63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E5=AE=87=E4=BC=B8?= Date: Wed, 11 Sep 2024 00:46:24 +0800 Subject: [PATCH 4/7] Apply suggestion --- library/ssl.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl.po b/library/ssl.po index 7bf98b335c..ba9ddc9ed4 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -1512,7 +1512,7 @@ msgid "" "sent to the peer." msgstr "" "在握手過程中,OpenSSL 會去配對主機名稱或 IP 地址。已不再使用 :func:" -"`match_hostname` 函數。如果 OpenSSL 拒絕某個主機名稱或 IP 地址,握手將會提前" +"`match_hostname` 函式。如果 OpenSSL 拒絕某個主機名稱或 IP 地址,握手將會提前" "中止,並向對方發送 TLS 警報訊息。" #: ../../library/ssl.rst:1148 From 7ba8496f960a70667e6b557793a98e817e368535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E5=AE=87=E4=BC=B8?= Date: Sun, 22 Sep 2024 18:20:50 +0800 Subject: [PATCH 5/7] Apply suggestion --- library/ssl.po | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/library/ssl.po b/library/ssl.po index ba9ddc9ed4..2fb2c4be45 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-08-04 00:03+0000\n" -"PO-Revision-Date: 2024-09-11 00:48+0800\n" +"PO-Revision-Date: 2024-09-22 18:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1535,11 +1535,11 @@ msgid "" "of the *Subject Alternative Name* extension (see :rfc:`3280`), there will " "also be a ``subjectAltName`` key in the dictionary." msgstr "" -"如果 ``binary_form`` 參數為 :const:`False`,且從對端接收到證書,則該方法回傳" -"一個 :class:`dict` 實例。如果證書未被驗證,則該字典為空。若證書已被驗證,則返" -"回的字典將包含數個鍵值,包括 ``subject`` (證書所簽發的對象) 和 ``issuer`` (簽" -"發證書的主體)。如果證書中包含 *Subject Alternative Name* 擴充 (參考\\ :rfc:" -"`3280`\\ ),字典中還會有一個 ``subjectAltName`` 鍵。" +"如果 ``binary_form`` 參數為 :const:`False`,且從對等 (peer) 接收到證書,則該" +"方法回傳一個 :class:`dict` 實例。如果證書未被驗證,則該字典為空。若證書已被驗" +"證,則返回的字典將包含數個鍵值,包括 ``subject`` (證書所簽發的對象) 和 " +"``issuer`` (簽發證書的主體)。如果證書中包含 *Subject Alternative Name* 擴充 " +"(參考\\ :rfc:`3280`\\ ),字典中還會有一個 ``subjectAltName`` 鍵。" #: ../../library/ssl.rst:1161 msgid "" @@ -1560,15 +1560,15 @@ msgid "" "certificate. Whether the peer provides a certificate depends on the SSL " "socket's role:" msgstr "" -"如果 ``binary_form`` 參數設定為 :const:`True`,且對端提供了證書,則該方法會" -"以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對端未提供證書,則回傳 :" -"const:`None`。對端是否提供證書取決於 SSL socket 的腳色:" +"如果 ``binary_form`` 參數設定為 :const:`True`,且對等提供了證書,則該方法會" +"以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對等未提供證書,則回傳 :" +"const:`None`。對等是否提供證書取決於 SSL socket 的腳色:" #: ../../library/ssl.rst:1191 msgid "" "for a client SSL socket, the server will always provide a certificate, " "regardless of whether validation was required;" -msgstr "對於客戶端 SSL socket,伺服器將永遠提供證書,無論是否需要進行驗證。" +msgstr "對於客戶端 SSL socket,伺服器將永遠提供證書,無論是否需要進行驗證;" #: ../../library/ssl.rst:1194 msgid "" From 8ceacdee7a8ba02c0f4a343d497aed7f45fc22f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E5=AE=87=E4=BC=B8?= Date: Sun, 22 Sep 2024 18:22:54 +0800 Subject: [PATCH 6/7] Apply suggestion --- library/ssl.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl.po b/library/ssl.po index 2fb2c4be45..8253be94e0 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -1562,7 +1562,7 @@ msgid "" msgstr "" "如果 ``binary_form`` 參數設定為 :const:`True`,且對等提供了證書,則該方法會" "以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對等未提供證書,則回傳 :" -"const:`None`。對等是否提供證書取決於 SSL socket 的腳色:" +"const:`None`。對等是否提供證書取決於 SSL socket 的腳色:" #: ../../library/ssl.rst:1191 msgid "" From fc5d0fb49fb5f33864b179cbdc13d9beee8e2624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E5=AE=87=E4=BC=B8?= Date: Sun, 22 Sep 2024 18:25:34 +0800 Subject: [PATCH 7/7] Apply suggestion --- library/ssl.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl.po b/library/ssl.po index 8253be94e0..1c4356b97b 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -1561,7 +1561,7 @@ msgid "" "socket's role:" msgstr "" "如果 ``binary_form`` 參數設定為 :const:`True`,且對等提供了證書,則該方法會" -"以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對等未提供證書,則回傳 :" +"以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對等未提供證書,則回傳:" "const:`None`。對等是否提供證書取決於 SSL socket 的腳色:" #: ../../library/ssl.rst:1191