envoyproxy / envoyproxy/gateway
http1.1 still works when only h2 is specified in the tls.ALPNApplications of the CTP
- Dominant language
- Go
- Stars
- 3k
- Forks
- 864
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 140
Description
```
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: ClientTrafficPolicy
metadata:
name: h2-only-policy
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: eg
tls:
alpnProtocols:
- h2
```
When tested using curl with `--http1.1` option, the requests still succeed, and the ALPN is HTTP/1.1.
```
curl -v -HHost:www.example.com --resolve "www.example.com:443:${GATEWAY_HOST}" \
--cacert example.com.crt https://www.example.com/get --http1.1
* Added www.example.com:443:172.18.0.200 to DNS cache
* Hostname www.example.com was found in DNS cache
* Trying 172.18.0.200:443...
* ALPN: curl offers http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CAfile: example.com.crt
* CApath: none
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / x25519 / RSASSA-PSS
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
* subject: CN=www.example.com; O=example organization
* start date: Aug 20 16:11:54 2025 GMT
* expire date: Aug 20 16:11:54 2026 GMT
* common name: www.example.com (matched)
* issuer: O=example Inc.; CN=example.com
* SSL certificate verify ok.
* Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* Connected to www.example.com (172.18.0.200) port 443
* using HTTP/1.x
> GET /get HTTP/1.1
> Host:www.example.com
> User-Agent: curl/8.14.1
> Accept: */*
```
Envoy access log also show the request is HTTP/1.1
```
{":authority":"www.example.com","bytes_received":0,"bytes_sent":470,"connection_termination_details":null,"downstream_local_address":"10.244.0.9:10443","downstream_remote_address":"172.18.0.1:56742","duration":0,"method":"GET","protocol":"HTTP/1.1","requested_server_name":null,"response_code":200,"response_code_details":"via_upstream","response_flags":"-","route_name":"httproute/default/backend/rule/0/match/0/www_example_com","start_time":"2025-08-20T16:46:48.607Z","upstream_cluster":"httproute/default/backend/rule/0","upstream_host":"10.244.0.8:3000","upstream_local_address":"10.244.0.9:33606","upstream_transport_failure_reason":null,"user-agent":"curl/8.14.1","x-envoy-origin-path":"/get","x-envoy-upstream-service-time":null,"x-forwarded-for":"172.18.0.1","x-request-id":"9edb9080-6b09-4730-8503-3d99cef03b6e"}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.