Error Handling not working with TLS


#1

I have been doing some penetration testing on my application. However none of the Error Pages are being brought up, and instead it goes right to the default index page. I have set up the HTTPErrorHandler as follows:

e.HTTPErrorHandler = func(err error, c echo.Context) {
	fmt.Println("I am in the error")
	code := http.StatusInternalServerError
	if he, ok := err.(*echo.HTTPError); ok {
		code = he.Code
	}
	errorPage := fmt.Sprintf("error/%d.html", code)
	if err := c.File(errorPage); err != nil {
		if err := c.File("error/err.html"); err != nil {
			c.Logger().Error(err)
			c.HTML(code, "This was a bad error")
		}
		c.Logger().Error(err)
	}
	c.Logger().Error(err)
}

It is not even firing off the message saying that it is in the error handler! I have tested this on my local machine, and it works as expected. For additional information, I do have a HTTPRedirect Middleware running, I am using an extensive amount of routes, and I have a default root directory setup.

Thank you for your help, because I really need it!


#2

More information coming up. So apparently it is because I have my SSL Echo service running with HTML5 set to true and that causes this problem.