Procházet zdrojové kódy

fixed the host header issue

Mohamed Al Ashaal před 7 roky
rodič
revize
ecb66fb723
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 3 3
      server.go

+ 3 - 3
server.go

@@ -2,7 +2,7 @@ package main
 
 import (
 	"context"
-	// "crypto/tls"
+	"crypto/tls"
 	"errors"
 	"io/ioutil"
 	"net/http"
@@ -33,11 +33,11 @@ func InitServer() error {
 	_ = m
 	s := &http.Server{
 		Addr:      *HTTPS_ADDR,
-		// TLSConfig: &tls.Config{GetCertificate: m.GetCertificate},
+		TLSConfig: &tls.Config{GetCertificate: m.GetCertificate},
 		Handler:   ServeHTTP(),
 	}
 	log.SetOutput(ioutil.Discard)
-	return s.ListenAndServe()
+	return s.ListenAndServeTLS("", "")
 }
 
 // The main server handler