<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>HTTP/2 on </title>
    <link>/tags/http/2/</link>
    <description>Recent content in HTTP/2 on </description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language><atom:link href="/tags/http/2/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Spring Boot 3 开启 HTTP/2：h2 和 h2c 在什么场景下更合适？</title>
      <link>/posts/spring-boot-3-http2-h2-h2c/</link>
      <pubDate>Tue, 10 Mar 2026 11:00:00 +0800</pubDate>
      
      <guid>/posts/spring-boot-3-http2-h2-h2c/</guid>
      <description>写在前面 想给你的 Spring Boot API 提提速？开启 HTTP/2 (H2) 可能是成本最低、收益最高的方式之一。比起老掉牙的 HTTP/1.1，H2 靠着多路复用、头部压缩这些黑科技，能让你的请求跑得更快、更稳。
但在 Spring Boot 3 里动手前，你得先搞清楚两个概念：h2 和 h2c。别看只差一个字母，用法可是天差地别。
h2 vs. h2c：穿衣服还是“裸奔”？ 简单来说，这两者的区别就在于有没有 TLS（加密）：
h2 = HTTP/2 Over TLS（穿了防弹衣，安全，生产环境标配） h2c = HTTP/2 Cleartext（“裸奔”，明文传输，主打一个快） 1. 核心大比拼 特性 h2 (HTTP/2) h2c (HTTP/2 Cleartext) 安不安全？ 非常安全 (TLS) 不安全 (明文) 浏览器理你吗？ 所有现代浏览器都支持 浏览器基本都不支持 用在哪？ 公网、APP 接口 微服务内网、K8s 集群、gRPC 配置难吗？ 需要 SSL 证书 Spring Boot 3.5 以后一行配置搞定 2. 怎么配 h2？(带加密模式) 这是我们最常见的模式，毕竟为了安全，Chrome、Firefox 这些浏览器只认带加密的 HTTP/2。
怎么配：你需要个 KeyStore 证书，然后在 application.</description>
    </item>
    
  </channel>
</rss>
