Skip to content

Commit 2454ef3

Browse files
authored
Merge pull request yidao620c#247 from zkqiang/patch-1
修正 11.10 节的缩进
2 parents fd8832b + 9a5c5c4 commit 2454ef3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/c11/p10_add_ssl_to_network_services.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878

7979
.. code-block:: python
8080
81-
import ssl
81+
import ssl
8282
83-
class SSLMixin:
83+
class SSLMixin:
8484
'''
8585
Mixin class that adds support for SSL to existing servers based
8686
on the socketserver module.
@@ -253,7 +253,7 @@
253253
例如,web浏览器保存了主要的认证机构的证书,并使用它来为每一个HTTPS连接确认证书的合法性。
254254
对本小节示例而言,只是为了测试,我们可以创建自签名的证书,下面是主要步骤:
255255

256-
256+
::
257257
bash % openssl req -new -x509 -days 365 -nodes -out server_cert.pem \
258258
-keyout server_key.pem
259259
Generating a 1024 bit RSA private key
@@ -282,6 +282,7 @@
282282
在创建证书的时候,各个值的设定可以是任意的,但是”Common Name“的值通常要包含服务器的DNS主机名。
283283
如果你只是在本机测试,那么就使用”localhost“,否则使用服务器的域名。
284284

285+
::
285286
-----BEGIN RSA PRIVATE KEY-----
286287
MIICXQIBAAKBgQCZrCNLoEyAKF+f9UNcFaz5Osa6jf7qkbUl8si5xQrY3ZYC7juu
287288
nL1dZLn/VbEFIITaUOgvBtPv1qUWTJGwga62VSG1oFE0ODIx3g2Nh4sRf+rySsx2
@@ -300,6 +301,7 @@
300301

301302
服务器证书文件server_cert.pem内容类似下面这样:
302303

304+
::
303305
-----BEGIN CERTIFICATE-----
304306
MIIC+DCCAmGgAwIBAgIJAPMd+vi45js3MA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNV
305307
BAYTAlVTMREwDwYDVQQIEwhJbGxpbm9pczEQMA4GA1UEBxMHQ2hpY2FnbzEUMBIG

0 commit comments

Comments
 (0)