func main() { boshConfig := &gogobosh.Config{ Username: os.Getenv("BOSH_USERNAME"), Password: os.Getenv("BOSH_PASSWORD"), BOSHAddress: os.Getenv("BOSH_URI"), SkipSslValidation: true, } boshClient, err := gogobosh.NewClient(boshConfig) if err != nil { fmt.Println("Could not create bosh client") fmt.Println(err) os.Exit(1) } server := webs.CreateServer(boshClient, &http.Client{}) router := server.Start() http.Handle("/", router) err = http.ListenAndServe(":"+os.Getenv("PORT"), nil) if err != nil { fmt.Println("ListenAndServe:", err) } }
-----END CERTIFICATE----- client_cert: | -----BEGIN CERTIFICATE----- IAmAFakeClientCert -----END CERTIFICATE----- client_key: | -----BEGIN RSA PRIVATE KEY----- IAmAFakeClientKey -----END RSA PRIVATE KEY-----" }`, ""}, "basic") boshConfig := &gogobosh.Config{ Username: "******", Password: "******", BOSHAddress: fakeServer.URL, } boshClient, _ := gogobosh.NewClient(boshConfig) c = webs.CreateController(boshClient, &http.Client{}) }) It("returns an error", func() { Ω(c.LoadCerts(deployConfig, deploymentName)).Should(MatchError("invalid character '\"' in literal true (expecting 'r')")) }) }) Context("when the bosh deployment can be downloaded", func() { var ( clientCert, clientKey, caCert string ) JustBeforeEach(func() { setup(MockRoute{"GET", "/deployments/deployment-test", fmt.Sprintf(`{