Skip to content

Commit 3b3443e

Browse files
committed
custom server ALPN option
1 parent e47330a commit 3b3443e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

main.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -909,10 +909,16 @@ func makeServerTLSConfig(args *CLIArgs) (*tls.Config, error) {
909909
if err != nil {
910910
return nil, err
911911
}
912-
if !args.disableHTTP2 {
913-
cfg.NextProtos = []string{"h2", "http/1.1"}
914-
} else {
915-
cfg.NextProtos = []string{"http/1.1"}
912+
if args.tlsALPNEnabled {
913+
if len(args.tlsALPNProtos.values) == 0 {
914+
if !args.disableHTTP2 {
915+
cfg.NextProtos = []string{"h2", "http/1.1"}
916+
} else {
917+
cfg.NextProtos = []string{"http/1.1"}
918+
}
919+
} else {
920+
cfg.NextProtos = args.tlsALPNProtos.values
921+
}
916922
}
917923
return &cfg, nil
918924
}

0 commit comments

Comments
 (0)