You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/04/25 14:42:52 UTC

[GitHub] [apisix-dashboard] bisakhmondal commented on a change in pull request #1824: feat: support HTTPS for Manager API

bisakhmondal commented on a change in pull request #1824:
URL: https://github.com/apache/apisix-dashboard/pull/1824#discussion_r619826708



##########
File path: api/cmd/managerapi.go
##########
@@ -124,6 +124,24 @@ func NewManagerAPICommand() *cobra.Command {
 				}
 			}()
 
+			// HTTPS
+			if conf.SSLCert != "" && conf.SSLKey != "" {
+				addrSSL := fmt.Sprintf("%s:%d", conf.ServerHost, conf.SSLPort)
+				serverSSL := &http.Server{
+					Addr:         addrSSL,
+					Handler:      r,
+					ReadTimeout:  time.Duration(1000) * time.Millisecond,
+					WriteTimeout: time.Duration(5000) * time.Millisecond,
+				}

Review comment:
       Hey, Nice work :+1: . 
   I think we should `go` with adding a custom TLS configuration to make it more secure. Also, a go server automatically upgrades requests to HTTP/2 if a tlsconfig is set with HTTPS.
   
   Referring to an awesome blog from [cloudflare](https://blog.cloudflare.com/exposing-go-on-the-internet/).
   Thanks :)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org