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)
	}
}
	testCertificate, _ := tls.X509KeyPair([]byte(testClientCert), []byte(testClientKey))
	tlsConfig := &tls.Config{
		RootCAs:            testCa,
		Certificates:       []tls.Certificate{testCertificate},
		InsecureSkipVerify: skipSSL,
	}
	tr := &http.Transport{
		TLSClientConfig: tlsConfig,
	}
	return tr
}

var _ = Describe("Server", func() {
	Describe("#CreateServer", func() {
		It("returns a server object", func() {
			Ω(webs.CreateServer(&gogobosh.Client{}, &http.Client{})).Should(BeAssignableToTypeOf(&webs.Server{}))
		})
	})
})

var _ = Describe("Contoller", func() {
	Describe("#CreateController", func() {
		It("returns a controller object", func() {
			controller := webs.CreateController(&gogobosh.Client{}, &http.Client{})
			Ω(controller).Should(BeAssignableToTypeOf(&webs.Controller{}))
		})
	})

	Describe("#LoadCerts", func() {
		var (
			c              *webs.Controller