talos
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5//go:build !sidero.debug
6
7package client8
9import (10"google.golang.org/grpc/credentials"11
12clientconfig "github.com/siderolabs/talos/pkg/machinery/client/config"13)
14
15// RequireTransportSecurity implements credentials.PerRPCCredentials.
16func (c BasicAuth) RequireTransportSecurity() bool {17return true18}
19
20func buildCredentials(configContext *clientconfig.Context, endpoints []string) (credentials.TransportCredentials, error) {21tlsConfig, err := buildTLSConfig(configContext)22if err != nil {23return nil, err24}25
26return credentials.NewTLS(tlsConfig), nil27}
28