Skip to content

Commit 33676f0

Browse files
committed
clair: enable h2c
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
1 parent fbc62bb commit 33676f0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cmd/clair/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ func serveAPI(ctx context.Context, cfg *config.Config) func() error {
116116
BaseContext: func(_ net.Listener) context.Context {
117117
return context.WithoutCancel(ctx)
118118
},
119+
Protocols: func() *http.Protocols {
120+
var p http.Protocols
121+
p.SetHTTP1(true)
122+
p.SetUnencryptedHTTP2(true)
123+
return &p
124+
}(),
119125
}
120126
srv.Handler, err = httptransport.New(ctx, cfg, srvs.Indexer, srvs.Matcher, srvs.Notifier)
121127
if err != nil {
@@ -132,6 +138,7 @@ func serveAPI(ctx context.Context, cfg *config.Config) func() error {
132138
}
133139
cfg.NextProtos = []string{"h2"}
134140
srv.TLSConfig = cfg
141+
srv.Protocols.SetHTTP2(true)
135142
l = tls.NewListener(l, cfg)
136143
}
137144
health.Ready()

0 commit comments

Comments
 (0)