diff --git a/cmd/tesla-http-proxy/main.go b/cmd/tesla-http-proxy/main.go index a0b69bd..8a624cc 100644 --- a/cmd/tesla-http-proxy/main.go +++ b/cmd/tesla-http-proxy/main.go @@ -1,7 +1,6 @@ package main import ( - "bytes" "context" "flag" "fmt" @@ -103,15 +102,6 @@ func main() { return } - if tlsPublicKey, err := protocol.LoadPublicKey(httpConfig.keyFilename); err == nil { - if bytes.Equal(tlsPublicKey.Bytes(), skey.PublicBytes()) { - fmt.Fprintln(os.Stderr, "It is unsafe to use the same private key for TLS and command authentication.") - fmt.Fprintln(os.Stderr, "") - fmt.Fprintln(os.Stderr, "Generate a new TLS key for this server.") - return - } - } - log.Debug("Creating proxy") p, err := proxy.New(context.Background(), skey, cacheSize) if err != nil { @@ -126,7 +116,7 @@ func main() { // method of your implementation can perform your business logic and then, if the request is // authorized, invoke p.ServeHTTP. Finally, replace p in the below ListenAndServeTLS call with // an object of your newly created type. - log.Error("Server stopped: %s", http.ListenAndServeTLS(addr, httpConfig.certFilename, httpConfig.keyFilename, p)) + log.Error("Server stopped: %s", http.ListenAndServe(addr, p)) } // readConfig applies configuration from environment variables. diff --git a/pkg/proxy/command.go b/pkg/proxy/command.go index 4b968e6..a7bec5d 100644 --- a/pkg/proxy/command.go +++ b/pkg/proxy/command.go @@ -178,12 +178,12 @@ func ExtractCommandAction(ctx context.Context, command string, params RequestPar case "front": return func(v *vehicle.Vehicle) error { return v.OpenFrunk(ctx) }, nil case "rear": - return func(v *vehicle.Vehicle) error { return v.OpenTrunk(ctx) }, nil + return func(v *vehicle.Vehicle) error { return v.ActuateTrunk(ctx) }, nil default: return nil, &protocol.NominalError{Details: protocol.NewError("invalid_value", false, false)} } } - return func(v *vehicle.Vehicle) error { return v.OpenTrunk(ctx) }, nil + return func(v *vehicle.Vehicle) error { return v.ActuateTrunk(ctx) }, nil case "charge_port_door_open": return func(v *vehicle.Vehicle) error { return v.ChargePortOpen(ctx) }, nil case "charge_port_door_close":