1
0
Fork 0
mirror of https://github.com/Luzifer/vault-openvpn.git synced 2024-12-25 14:21:21 +00:00

Simplify TLS handling

This commit is contained in:
Miguel Eduardo Gil Biraud 2016-08-25 17:13:40 +02:00
parent 542310fd7a
commit 9bbffb9896

View file

@ -7,7 +7,6 @@ import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
"text/template"
@ -15,7 +14,6 @@ import (
"github.com/Luzifer/go_helpers/str"
"github.com/Luzifer/rconfig"
"github.com/hashicorp/go-rootcerts"
"github.com/hashicorp/vault/api"
homedir "github.com/mitchellh/go-homedir"
)
@ -101,14 +99,9 @@ func main() {
var err error
clientConfig := api.DefaultConfig()
clientConfig.ReadEnvironment()
clientConfig.Address = cfg.VaultAddress
tlsConfig := clientConfig.HttpClient.Transport.(*http.Transport).TLSClientConfig
err = rootcerts.ConfigureTLS(tlsConfig, nil)
if err != nil {
log.Fatalf("Could not configure TLS: %s", err)
}
client, err = api.NewClient(clientConfig)
if err != nil {
log.Fatalf("Could not create Vault client: %s", err)