Skip to content

Commit

Permalink
feat: http config
Browse files Browse the repository at this point in the history
  • Loading branch information
hokamsingh committed Sep 2, 2024
1 parent 51a7d49 commit 5bbcd3a
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions internal/core/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,8 @@ func (r *Router) Start(addr string, httpConfig *config.HttpConfig) error {
// Set maximum header size
MaxHeaderBytes: httpConfig.MaxHeaderSize,
}
log.Printf("not here %v %v", httpConfig.TLSCertFile, httpConfig.TLSKeyFile)
// Configure TLS if certificates are provided
if httpConfig.TLSCertFile != "" && httpConfig.TLSKeyFile != "" {
log.Print("Configure TLS if certificates are provided")
server.TLSConfig = &tls.Config{
MinVersion: tls.VersionTLS12, // Example of configuring TLS settings
}
Expand All @@ -389,7 +387,6 @@ func (r *Router) Start(addr string, httpConfig *config.HttpConfig) error {
}

// Start HTTPS server with TLS
log.Print("here")
err := server.ListenAndServeTLS(httpConfig.TLSCertFile, httpConfig.TLSKeyFile)
if err != nil {
log.Fatalf("HTTPS server failed: %v", err)
Expand Down

0 comments on commit 5bbcd3a

Please sign in to comment.