Add all root certificates by default on bootstrap methods.

This commit is contained in:
Mariano Cano 2019-01-07 18:55:40 -08:00
parent d296cf95a9
commit 6d3e8ed93c
2 changed files with 10 additions and 0 deletions

View file

@ -87,6 +87,9 @@ func BootstrapServer(ctx context.Context, token string, base *http.Server, optio
return nil, err
}
// Make sure the tlsConfig have all supported roots
options = append(options, AddRootsToClientCAs(), AddRootsToRootCAs())
tlsConfig, err := client.GetServerTLSConfig(ctx, sign, pk, options...)
if err != nil {
return nil, err
@ -130,6 +133,9 @@ func BootstrapClient(ctx context.Context, token string, options ...TLSOption) (*
return nil, err
}
// Make sure the tlsConfig have all supported roots
options = append(options, AddRootsToRootCAs())
transport, err := client.Transport(ctx, sign, pk, options...)
if err != nil {
return nil, err