Skip to content

Enhance security options #1890

Answered by aldas
Kukulkano asked this question in Q&A
Jun 8, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

If you need custom configuration for TLS when you would need to create something like that

func main() {
	e := echo.New()
	// create for Echo routes
	
	s := http.Server{
		Addr:    ":8443",
		Handler: e, // set Echo as handler
		TLSConfig: &tls.Config{
			//Certificates: nil, // <-- s.ListenAndServeTLS will populate this field for you
			//CipherSuites:                nil,
			//PreferServerCipherSuites:    false,
			//MinVersion:                  0,
			//MaxVersion:                  0,
			//CurvePreferences:            nil,
		},
	}
	if err := s.ListenAndServeTLS("server.crt", "server.key"); err != http.ErrServerClosed {
		log.Fatal(err)
	}
}

If you need to add headers to responses. do:

func 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Kukulkano
Comment options

Answer selected by Kukulkano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants