mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 09:12:28 +00:00
service: fix alpn certificate usage
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -566,6 +566,7 @@ func (o *options) parseTLSConfig() error {
|
||||
if o.tlsConfig != nil {
|
||||
return nil
|
||||
}
|
||||
nextProtos := []string{"h2", "h2c", "http/1.1", "acme-tls/1"}
|
||||
if !o.hasTLSConfig() {
|
||||
if !o.secure {
|
||||
return nil
|
||||
@ -593,6 +594,7 @@ func (o *options) parseTLSConfig() error {
|
||||
o.tlsConfig = &tls.Config{
|
||||
Certificates: []tls.Certificate{cert},
|
||||
ClientAuth: tls.NoClientCert,
|
||||
NextProtos: nextProtos,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -612,6 +614,7 @@ func (o *options) parseTLSConfig() error {
|
||||
o.tlsConfig = &tls.Config{
|
||||
Certificates: []tls.Certificate{cert},
|
||||
RootCAs: caCertPool,
|
||||
NextProtos: nextProtos,
|
||||
}
|
||||
if !o.hasClientTLSConfig() {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user