Skip to content

Commit 5e8bf33

Browse files
committed
clair: enable h2c
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
1 parent b1d6551 commit 5e8bf33

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
@@ -115,6 +115,12 @@ func serveAPI(ctx context.Context, cfg *config.Config) func() error {
115115
BaseContext: func(_ net.Listener) context.Context {
116116
return context.WithoutCancel(ctx)
117117
},
118+
Protocols: func() *http.Protocols {
119+
var p http.Protocols
120+
p.SetHTTP1(true)
121+
p.SetUnencryptedHTTP2(true)
122+
return &p
123+
}(),
118124
}
119125
srv.Handler, err = httptransport.New(ctx, cfg, srvs.Indexer, srvs.Matcher, srvs.Notifier)
120126
if err != nil {
@@ -131,6 +137,7 @@ func serveAPI(ctx context.Context, cfg *config.Config) func() error {
131137
}
132138
cfg.NextProtos = []string{"h2"}
133139
srv.TLSConfig = cfg
140+
srv.Protocols.SetHTTP2(true)
134141
l = tls.NewListener(l, cfg)
135142
}
136143
health.Ready()

0 commit comments

Comments
 (0)