func (c *Component) GetTLSServerConfig(ctx context.Context, opts ...TLSConfigOption) (*tls.Config, error) {
	conf := c.GetBaseConfig(ctx).TLS
	cipherSuites, err := conf.GetCipherSuites()
	if cipherSuites != nil {
		log.FromContext(ctx).Warn("TLS is configured to use a custom set of cipher suites. Make sure that your list is up to date, or disable the custom cipher suites")
	}
	if err != nil {
		return nil, err
	}
	res := &tls.Config{
		MinVersion:   tls.VersionTLS12,
		CipherSuites: cipherSuites,
	}
	if conf.Source == "" {
		switch {
		case conf.ACME.Enable:
			conf.Source = "acme"
		case conf.Certificate != "" && conf.Key != "":
			conf.Source = "file"
		case !conf.KeyVault.IsZero():
			conf.Source = "key-vault"
		}
	}
	if conf.Source == "key-vault" {
		conf.KeyVault.KeyVault = c.KeyVault
	}
	if err := conf.ServerAuth.ApplyTo(res); err != nil {
		return nil, err
	}
	for _, opt := range opts {
		opt.apply(res)
	}
	return res, nil
}
GetTLSServerConfig gets the component's server TLS config and applies the given options.
package component
import (
	"context"
	"crypto/tls"
	"crypto/x509"
	"go.thethings.network/lorawan-stack/v3/pkg/log"
)
type TLSConfigOption interface {
	apply(*tls.Config)
}
type TLSConfigOptionFunc func(*tls.Config)
func (fn TLSConfigOptionFunc) apply(c *tls.Config) {
	fn(c)
}
func WithTLSClientAuth(auth tls.ClientAuthType, cas *x509.CertPool, verify func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error) TLSConfigOption {
	return TLSConfigOptionFunc(func(c *tls.Config) {
		c.ClientAuth = auth
		c.ClientCAs = cas
		c.VerifyPeerCertificate = verify
	})
}
func WithTLSCertificates(certificates ...tls.Certificate) TLSConfigOption {
	return TLSConfigOptionFunc(func(c *tls.Config) {
		c.Certificates = certificates
	})
}
func WithNextProtos(protos ...string) TLSConfigOption {
	return TLSConfigOptionFunc(func(c *tls.Config) {
		c.NextProtos = append(c.NextProtos, protos...)
	})
}