[{"data":1,"prerenderedAt":715},["ShallowReactive",2],{"page-\u002Fnetwork\u002Fhttp协议":3},{"id":4,"title":5,"body":6,"description":12,"extension":704,"meta":705,"navigation":710,"path":711,"seo":712,"stem":713,"__hash__":714},"content\u002Fnetwork\u002FHTTP协议.md","HTTP协议",{"type":7,"value":8,"toc":697},"minimark",[9,13,16,19,23,26,163,173,184,187,190,196,199,205,427,430,442,445,588,599,606,609,615,618,621,624,630,645,648,651,657,668,671,677,688,694],[10,11,12],"p",{},"HTTP是工作在应用层的协议，用于在客户端比如浏览器和服务器之间传输数据，是web的基石，采用的是请求-响应模型，无状态、可扩展。",[10,14,15],{},"状态码来说：",[10,17,18],{},"1xx比如101 Switching Protocols。2xx开头是成功的，比如200 OK 201 Created、204 No Content。3xx开头为重定向，301是永久重定向，302是临时的。4xx开头是客户端错误，5开头的是服务端错误。",[20,21,22],"h2",{"id":22},"常见头部",[10,24,25],{},"常见请求头\u002F响应头",[27,28,29,42],"table",{},[30,31,32],"thead",{},[33,34,35,39],"tr",{},[36,37,38],"th",{},"头部",[36,40,41],{},"作用",[43,44,45,57,67,77,87,97,111,121,134,146,156],"tbody",{},[33,46,47,54],{},[48,49,50],"td",{},[51,52,53],"code",{},"Host",[48,55,56],{},"目标主机（HTTP\u002F1.1 必需）",[33,58,59,64],{},[48,60,61],{},[51,62,63],{},"Content-Type",[48,65,66],{},"报文体的 MIME 类型",[33,68,69,74],{},[48,70,71],{},[51,72,73],{},"Content-Length",[48,75,76],{},"报文体长度",[33,78,79,84],{},[48,80,81],{},[51,82,83],{},"Accept",[48,85,86],{},"客户端可接受的类型",[33,88,89,94],{},[48,90,91],{},[51,92,93],{},"Authorization",[48,95,96],{},"认证凭证（如 Bearer Token）",[33,98,99,108],{},[48,100,101,104,105],{},[51,102,103],{},"Cookie"," \u002F ",[51,106,107],{},"Set-Cookie",[48,109,110],{},"会话状态管理",[33,112,113,118],{},[48,114,115],{},[51,116,117],{},"Cache-Control",[48,119,120],{},"缓存策略",[33,122,123,131],{},[48,124,125,104,128],{},[51,126,127],{},"ETag",[51,129,130],{},"If-None-Match",[48,132,133],{},"协商缓存",[33,135,136,144],{},[48,137,138,104,141],{},[51,139,140],{},"Last-Modified",[51,142,143],{},"If-Modified-Since",[48,145,133],{},[33,147,148,153],{},[48,149,150],{},[51,151,152],{},"Access-Control-Allow-Origin",[48,154,155],{},"CORS 跨域许可",[33,157,158,161],{},[48,159,160],{},"浏览器同源策略限制跨域请求。CORS 通过响应头授权：",[48,162],{},[164,165,170],"pre",{"className":166,"code":168,"language":169},[167],"language-text","Access-Control-Allow-Origin: https:\u002F\u002Fexample.com\nAccess-Control-Allow-Methods: GET, POST\nAccess-Control-Allow-Headers: Content-Type\nAccess-Control-Allow-Credentials: true\n","text",[51,171,168],{"__ignoreMap":172},"",[10,174,175,179,180,183],{},[176,177,178],"strong",{},"预检请求","：非简单请求（如 PUT、自定义头）会先发 ",[51,181,182],{},"OPTIONS"," 请求确认。OPTIONS请求，cors预检请求的响应状态码通常是204 No Content。当使用了非简单方法比如PUT、DELETE、PATCH等的时候就会自动发送这个，或是使用了自定义请求头Authorization、X-Custom-Header也会。这个在另一个笔记里 [[RestfulAPI和GraphQL]] 这里有讲过，可以直接看。",[20,185,186],{"id":186},"长连接",[10,188,189],{},"http长连接核心是复用一个tcp连接发送多个请求，避免每次都重新握手等。短连接是http\u002F1.0默认，每次都要经过tcp握手。长连接是http\u002F1.1默认（通过keep-alive复用实现），多个请求会复用一个tcp。但是http\u002F1.1会有队头阻塞问题，同一个连接上，前一个请求还没有响应完，后面的请求要等待。h2里面连接本身就是一个多路复用器了。",[191,192,193],"blockquote",{},[10,194,195],{},"只需要一个tcp连接是设计目标但是不是绝对的，准确说，每个origin通常有一条，不是全站一条",[10,197,198],{},"http\u002F2的多路复用解决了这个问题：",[164,200,203],{"className":201,"code":202,"language":169},[167],"一个 TCP 连接\n    ├── Stream 1: 请求 A\n    ├── Stream 2: 请求 B\n    ├── Stream 3: 请求 C\n    └── 并发传输，互不阻塞\n",[51,204,202],{"__ignoreMap":172},[206,207,212,216,220,224,235,244,251,260,266,274,278,283,287,292,296,300,303,306,309,312,315,318,322,326,329,332,335,338,344,348,354,359,366,371,377,381,385,389,393,397,400,403,406,410,414,417,420,423],"svg",{"viewBox":208,"width":209,"role":210,"xmlns":211},"0 0 680 360","100%","img","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg",[213,214,215],"title",{},"HTTP\u002F1.1 与 HTTP\u002F2 的连接模型对比",[217,218,219],"desc",{},"HTTP\u002F1.1 每个域名开多条 TCP 连接，每条连接上的请求串行排队；HTTP\u002F2 每个域名只用一条 TCP 连接，多个流在同一连接上并行复用。",[221,222,223],"style",{},"\n.bx{stroke-width:.5}\n.tt{font:500 14px ui-sans-serif,system-ui,sans-serif}\n.cp{font:400 12px ui-sans-serif,system-ui,sans-serif}\n.sm{font:500 11px ui-monospace,SFMono-Regular,Consolas,monospace}\n",[225,226],"rect",{"className":227,"x":229,"y":229,"width":230,"height":231,"rx":232,"fill":233,"stroke":234},[228],"bx","40","280","300","16","#FFFFFF","#D3D1C7",[169,236,243],{"className":237,"x":239,"y":240,"dominantBaseline":241,"fill":242},[238],"tt","60","68","central","#633806","HTTP\u002F1.1",[169,245,250],{"className":246,"x":239,"y":248,"dominantBaseline":241,"fill":249},[247],"cp","90","#854F0B","每域名 6 条连接，请求串行排队",[225,252],{"className":253,"x":239,"y":254,"width":255,"height":256,"rx":257,"fill":258,"stroke":259},[228],"120","56","180","6","#FAEEDA","#EF9F27",[225,261],{"className":262,"x":240,"y":263,"width":229,"height":264,"rx":265,"fill":233,"stroke":259},[228],"132","44","4",[169,267,273],{"className":268,"x":270,"y":271,"textAnchor":272,"dominantBaseline":241,"fill":249},[269],"sm","88","154","middle","1",[225,275],{"className":276,"x":240,"y":277,"width":229,"height":264,"rx":265,"fill":233,"stroke":259},[228],"188",[169,279,282],{"className":280,"x":270,"y":281,"textAnchor":272,"dominantBaseline":241,"fill":249},[269],"210","2",[225,284],{"className":285,"x":240,"y":286,"width":229,"height":264,"rx":265,"fill":233,"stroke":259},[228],"244",[169,288,291],{"className":289,"x":270,"y":290,"textAnchor":272,"dominantBaseline":241,"fill":249},[269],"266","3",[225,293],{"className":294,"x":295,"y":254,"width":255,"height":256,"rx":257,"fill":258,"stroke":259},[228],"152",[225,297],{"className":298,"x":299,"y":263,"width":229,"height":264,"rx":265,"fill":233,"stroke":259},[228],"160",[169,301,273],{"className":302,"x":256,"y":271,"textAnchor":272,"dominantBaseline":241,"fill":249},[269],[225,304],{"className":305,"x":299,"y":277,"width":229,"height":264,"rx":265,"fill":233,"stroke":259},[228],[169,307,282],{"className":308,"x":256,"y":281,"textAnchor":272,"dominantBaseline":241,"fill":249},[269],[225,310],{"className":311,"x":299,"y":286,"width":229,"height":264,"rx":265,"fill":233,"stroke":259},[228],[169,313,291],{"className":314,"x":256,"y":290,"textAnchor":272,"dominantBaseline":241,"fill":249},[269],[225,316],{"className":317,"x":286,"y":254,"width":255,"height":256,"rx":257,"fill":258,"stroke":259},[228],[225,319],{"className":320,"x":321,"y":263,"width":229,"height":264,"rx":265,"fill":233,"stroke":259},[228],"252",[169,323,273],{"className":324,"x":325,"y":271,"textAnchor":272,"dominantBaseline":241,"fill":249},[269],"272",[225,327],{"className":328,"x":321,"y":277,"width":229,"height":264,"rx":265,"fill":233,"stroke":259},[228],[169,330,282],{"className":331,"x":325,"y":281,"textAnchor":272,"dominantBaseline":241,"fill":249},[269],[225,333],{"className":334,"x":321,"y":286,"width":229,"height":264,"rx":265,"fill":233,"stroke":259},[228],[169,336,291],{"className":337,"x":325,"y":290,"textAnchor":272,"dominantBaseline":241,"fill":249},[269],[169,339,343],{"className":340,"x":239,"y":341,"dominantBaseline":241,"fill":342},[247],"318","#5F5E5A","一个慢请求挡住后续请求",[225,345],{"className":346,"x":347,"y":229,"width":230,"height":231,"rx":232,"fill":233,"stroke":234},[228],"360",[169,349,353],{"className":350,"x":351,"y":240,"dominantBaseline":241,"fill":352},[238],"380","#0C447C","HTTP\u002F2",[169,355,358],{"className":356,"x":351,"y":248,"dominantBaseline":241,"fill":357},[247],"#185FA5","每域名 1 条连接，多路复用",[225,360],{"className":361,"x":351,"y":254,"width":362,"height":256,"rx":363,"fill":364,"stroke":365},[228],"240","8","#E6F1FB","#85B7EB",[169,367,370],{"className":368,"x":369,"y":271,"dominantBaseline":241,"fill":357},[269],"392","S1",[225,372],{"className":373,"x":374,"y":375,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],"414","137","34",[225,378],{"className":379,"x":380,"y":375,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],"464",[225,382],{"className":383,"x":384,"y":375,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],"514",[225,386],{"className":387,"x":388,"y":375,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],"564",[169,390,392],{"className":391,"x":369,"y":281,"dominantBaseline":241,"fill":357},[269],"S2",[225,394],{"className":395,"x":374,"y":396,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],"193",[225,398],{"className":399,"x":380,"y":396,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],[225,401],{"className":402,"x":384,"y":396,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],[225,404],{"className":405,"x":388,"y":396,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],[169,407,409],{"className":408,"x":369,"y":290,"dominantBaseline":241,"fill":357},[269],"S3",[225,411],{"className":412,"x":374,"y":413,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],"249",[225,415],{"className":416,"x":380,"y":413,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],[225,418],{"className":419,"x":384,"y":413,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],[225,421],{"className":422,"x":388,"y":413,"width":264,"height":376,"rx":265,"fill":233,"stroke":365},[228],[169,424,426],{"className":425,"x":351,"y":341,"dominantBaseline":241,"fill":342},[247],"多个流并行，互不阻塞",[10,428,429],{},"左边是为什么当年要做 h2:浏览器被逼着对一个域名开 6 条 TCP,每条上面请求还得排成一队,一个慢接口就把后面全卡住。h2 把这些塌缩成右边这一条连接,里面用 **stream(流)​ 区分不同请求,可以交错传输。",[191,431,432],{},[433,434,435,439],"ol",{},[436,437,438],"li",{},"刚才我们说过tcp按照origin算，不是按照页面算，如果站点使用了CDN、图床、第三方统计，那就是好几个不同的origin，各开各的。h2的连接合并不能跨origin。",[436,440,441],{},"浏览器没有义务只保持一条。连接建立慢时会开\"竞速连接\",连接空闲久了会回收,有网络切换或异常时也可能重建。",[10,443,444],{},"HTTP版本协商路径与占比：",[206,446,448,451,454,457,475,480,487,492,497,502,507,510,513,516,519,522,528,536,542,547,552,556,559,563,567,572,576,580,584],{"viewBox":447,"width":209,"role":210,"xmlns":211},"0 0 680 340",[213,449,450],{},"HTTP 版本是怎么协商出来的",[217,452,453],{},"浏览器只在 HTTPS 上通过 TLS 的 ALPN 扩展协商协议版本，服务端在 h3、h2、http\u002F1.1 中挑一个；明文 http 不参与协商，只能用 HTTP\u002F1.1。",[221,455,456],{},"\n.bx{stroke-width:.5}\n.tt{font:500 13px ui-sans-serif,system-ui,sans-serif}\n.cp{font:400 12px ui-sans-serif,system-ui,sans-serif}\n.sm{font:500 11px ui-monospace,SFMono-Regular,Consolas,monospace}\n",[458,459,460],"defs",{},[461,462,467],"marker",{"id":463,"viewBox":464,"refX":363,"refY":465,"markerWidth":257,"markerHeight":257,"orient":466},"arrow","0 0 10 10","5","auto-start-reverse",[468,469],"path",{"d":470,"fill":471,"stroke":472,"strokeWidth":473,"strokeLineCap":474,"strokeLineJoin":474},"M2 1L8 5L2 9","none","context-stroke","1.5","round",[225,476],{"className":477,"x":478,"y":229,"width":362,"height":264,"rx":363,"fill":479,"stroke":234},[228],"220","#F4F3F0",[169,481,486],{"className":482,"x":483,"y":484,"textAnchor":272,"dominantBaseline":241,"fill":485},[238],"340","62","#2C2C2A","浏览器请求 https:\u002F\u002F…",[468,488],{"d":489,"fill":471,"stroke":490,"strokeWidth":473,"markerEnd":491},"M340 84 V118","#888780","url(#arrow)",[225,493],{"className":494,"x":256,"y":495,"width":496,"height":255,"rx":363,"fill":364,"stroke":365},[228],"124","320",[169,498,501],{"className":499,"x":483,"y":500,"textAnchor":272,"dominantBaseline":241,"fill":352},[238],"143","TLS 握手 · ALPN 扩展",[169,503,506],{"className":504,"x":483,"y":505,"textAnchor":272,"dominantBaseline":241,"fill":357},[247],"163","客户端列出 h3 \u002F h2 \u002F http\u002F1.1",[468,508],{"d":509,"fill":471,"stroke":490,"strokeWidth":473},"M340 180 V200",[468,511],{"d":512,"fill":471,"stroke":490,"strokeWidth":473},"M132 200 H548",[468,514],{"d":515,"fill":471,"stroke":490,"strokeWidth":473,"markerEnd":491},"M132 200 V220",[468,517],{"d":518,"fill":471,"stroke":490,"strokeWidth":473,"markerEnd":491},"M340 200 V220",[468,520],{"d":521,"fill":471,"stroke":490,"strokeWidth":473,"markerEnd":491},"M548 200 V220",[169,523,527],{"className":524,"x":525,"y":526,"dominantBaseline":241,"fill":490},[269],"356","212","服务端挑一个",[225,529],{"className":530,"x":229,"y":531,"width":532,"height":533,"rx":363,"fill":534,"stroke":535},[228],"224","184","72","#E1F5EE","#5DCAA5",[169,537,541],{"className":538,"x":263,"y":539,"textAnchor":272,"dominantBaseline":241,"fill":540},[238],"246","#085041","HTTP\u002F3",[169,543,546],{"className":544,"x":263,"y":290,"textAnchor":272,"dominantBaseline":241,"fill":545},[247],"#0F6E56","QUIC over UDP",[169,548,551],{"className":549,"x":263,"y":550,"textAnchor":272,"dominantBaseline":241,"fill":545},[269],"286","≈21% 请求",[225,553],{"className":554,"x":555,"y":531,"width":532,"height":533,"rx":363,"fill":364,"stroke":365},[228],"248",[169,557,353],{"className":558,"x":483,"y":539,"textAnchor":272,"dominantBaseline":241,"fill":352},[238],[169,560,562],{"className":561,"x":483,"y":290,"textAnchor":272,"dominantBaseline":241,"fill":357},[247],"TCP · 多路复用",[169,564,566],{"className":565,"x":483,"y":550,"textAnchor":272,"dominantBaseline":241,"fill":357},[269],"≈51% 请求",[225,568],{"className":569,"x":570,"y":531,"width":532,"height":533,"rx":363,"fill":479,"stroke":571},[228],"456","#B4B2A9",[169,573,243],{"className":574,"x":575,"y":539,"textAnchor":272,"dominantBaseline":241,"fill":485},[238],"548",[169,577,579],{"className":578,"x":575,"y":290,"textAnchor":272,"dominantBaseline":241,"fill":342},[247],"TCP · 串行复用",[169,581,583],{"className":582,"x":575,"y":550,"textAnchor":272,"dominantBaseline":241,"fill":342},[269],"≈28% 请求",[169,585,587],{"className":586,"x":229,"y":341,"dominantBaseline":241,"fill":342},[247],"明文 http:\u002F\u002F 不参与 ALPN 协商，浏览器实际只用 HTTP\u002F1.1",[10,589,590,591,594,595,598],{},"h2 只跑在 TLS 上。浏览器的明文 h2(",[51,592,593],{},"h2c",")支持早就移除了,所以 ",[51,596,597],{},"http:\u002F\u002F"," 站点实际只能是 h1.1。这就是为什么\"h2 默认\"约等于\"HTTPS 默认\"。通过一个连接并发多个请求，将请求\u002F响应拆成帧，交错传输和头部压缩的方式解决了，http\u002F2的长连接更加高效，一个连接搞定所有请求。",[10,600,601,602,605],{},"所以，阅读完上面的文字，我们就能清楚。使用明文的http的时候基本就是h1.1协议，\"h2 需要 TLS\"、\"尽量维持一条连接更好\"，一条连接同时省掉 TCP 和 TLS 两套握手成本,而且",[176,603,604],{},"版本是绑死在连接上的","(ALPN 在建立时定,中途不能换),所以换连接就等于重来一遍。",[10,607,608],{},"长连接通过Connection: keep-alive声明，依靠tcp keep-alive传输层：",[164,610,613],{"className":611,"code":612,"language":169},[167],"setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on));\n",[51,614,612],{"__ignoreMap":172},[10,616,617],{},"可以检测连接是否还或者，对端挂了，网络断了。应用层自己会发送心跳包，比如说30s一个，来保持链接活跃。如果说应用崩溃，连接不会通过FIN关闭的话，内核会替他关闭，可能是RST，也可能是FIN，比如说进程如果被SIGKILL 杀死，还有未发送的消息，他就会发RST，处理完了就会发FIN。",[20,619,620],{"id":620},"头部压缩",[10,622,623],{},"头部压缩式http\u002F2的核心优化，因为http\u002F1.1头部每次都会携带大量重复头部：",[164,625,628],{"className":626,"code":627,"language":169},[167],"GET \u002Findex.html\nHost: example.com\nUser-Agent: Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) ...\nAccept: text\u002Fhtml,application\u002Fxhtml+xml,...\nAccept-Language: zh-CN,zh;q=0.9\nAccept-Encoding: gzip, deflate, br\nCookie: session=abc123; theme=dark; ...\nConnection: keep-alive\n",[51,629,627],{"__ignoreMap":172},[10,631,632,633,636,637,640,641,644],{},"下一个请求也是一样。每个头部都会重复传递这些，显然会浪费带宽，",[176,634,635],{},"HTTP\u002F1.1 用 gzip 压缩 body，但不压缩头部","——头部一直是明文。",[176,638,639],{},"HTTP\u002F2 引入头部压缩","——",[176,642,643],{},"HPACK","。61个常见头部，然后给编号压缩，这就是静态表，对于连接期间动态维护的头部，使用索引来压缩，这就是静态表。对字符串使用哈夫曼编码，这样就可以让头部压缩很大一部分。",[20,646,647],{"id":647},"https",[10,649,650],{},"我们都知道http是明文传输，数据裸奔，中间人可以直接看到密码、cookie等信息 还能篡改，https可以用tls解决这些问题，https分为四层：",[164,652,655],{"className":653,"code":654,"language":169},[167],"HTTP          ← 应用层\n  ↓\nTLS\u002FSSL       ← 安全层（加解密、认证、完整性）\n  ↓\nTCP           ← 传输层\n  ↓\nIP            ← 网络层\n",[51,656,654],{"__ignoreMap":172},[10,658,659,660,663,664,667],{},"https = http + tls，http报文会被tls加密之后走tcp传输。tls使用非对称加密，在握手阶段解决。公钥是公开的，私钥是服务器自己保留，握手阶段会协商出",[176,661,662],{},"会话秘钥","，对称加密使用一个秘钥加解密，在",[176,665,666],{},"非对称加密协商","的时候，这个秘钥会被协商出来。",[10,669,670],{},"我们用tls1.2版本解释：",[164,672,675],{"className":673,"code":674,"language":169},[167],"客户端                                服务器\n  │                                    │\n  │ ① Client Hello                    │\n  │   - 支持的 TLS 版本                 │\n  │   - 支持的加密套件                   │\n  │   - 客户端随机数（Random1）          │\n  │ ─────────────────────────────────> │\n  │                                    │\n  │ ② Server Hello                    │\n  │   - 选定的 TLS 版本                 │\n  │   - 选定的加密套件                   │\n  │   - 服务器随机数（Random2）          │\n  │ \u003C───────────────────────────────── │\n  │                                    │\n  │ ③ Certificate                     │\n  │   - 服务器证书（含公钥）             │\n  │ \u003C───────────────────────────────── │\n  │                                    │\n  │ ④ Server Key Exchange（可选）      │\n  │   - 密钥交换参数                    │\n  │ \u003C───────────────────────────────── │\n  │                                    │\n  │ ⑤ Server Hello Done               │\n  │ \u003C───────────────────────────────── │\n  │                                    │\n  │ ⑥ 客户端验证证书                    │\n  │   - 检查证书是否可信                 │\n  │   - 检查域名是否匹配                 │\n  │   - 检查是否过期                    │\n  │                                    │\n  │ ⑦ Client Key Exchange             │\n  │   - 用服务器公钥加密\"预主密钥\"       │\n  │ ─────────────────────────────────> │\n  │                                    │\n  │ ⑧ Change Cipher Spec              │\n  │   - 通知\"后续用协商的密钥加密\"       │\n  │ ─────────────────────────────────> │\n  │                                    │\n  │ ⑨ Finished                        │\n  │   - 加密的握手摘要                  │\n  │ ─────────────────────────────────> │\n  │                                    │\n  │ ⑩ Change Cipher Spec              │\n  │ \u003C───────────────────────────────── │\n  │                                    │\n  │ ⑪ Finished                        │\n  │ \u003C───────────────────────────────── │\n  │                                    │\n  │ ⑫ 开始加密通信（对称加密）           │\n  │ \u003C════════════════════════════════> │\n",[51,676,674],{"__ignoreMap":172},[10,678,679,680,683,684,687],{},"客户端会检查证书链，证书是否是可信CA签发，浏览器会内置CA列表。证书里面的域名是否匹配访问的域名，以及是否过期。客户端会生成",[176,681,682],{},"预主秘钥","，用于服务器公钥加密，发送给服务器，服务器用",[176,685,686],{},"私钥解密","，拿到预主密钥。",[164,689,692],{"className":690,"code":691,"language":169},[167],"主密钥 = PRF(预主密钥, \"master secret\", Random1 + Random2)\n",[51,693,691],{"__ignoreMap":172},[10,695,696],{},"主密钥用来生成会话秘钥，也就是对称加密的秘钥，这样握手就完成了。",{"title":172,"searchDepth":698,"depth":698,"links":699},2,[700,701,702,703],{"id":22,"depth":698,"text":22},{"id":186,"depth":698,"text":186},{"id":620,"depth":698,"text":620},{"id":647,"depth":698,"text":647},"md",{"date":706,"tags":707},"2026-12-10",[708,709],"network","http",true,"\u002Fnetwork\u002Fhttp协议",{"description":12},"network\u002FHTTP协议","BgxpYzLGW5O8g-IruTHvVKN7OngJt2Ze7xXt6PqlqHU",1791808060660]