0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

Log if host is not configured for server

This commit is contained in:
Matthew Holt 2016-01-11 09:07:14 -07:00
parent 77eae62d9f
commit 8a6c778c8d
2 changed files with 2 additions and 3 deletions

View file

@ -113,9 +113,6 @@ func MarkQualified(configs []server.Config) {
// ObtainCerts obtains certificates for all these configs as long as a certificate does not // ObtainCerts obtains certificates for all these configs as long as a certificate does not
// already exist on disk. It does not modify the configs at all; it only obtains and stores // already exist on disk. It does not modify the configs at all; it only obtains and stores
// certificates and keys to the disk. // certificates and keys to the disk.
//
// TODO: Right now by potentially prompting about ToS error, we assume this function is only
// called at startup, but that is not always the case because it could be during a restart.
func ObtainCerts(configs []server.Config, altPort string) error { func ObtainCerts(configs []server.Config, altPort string) error {
groupedConfigs := groupConfigsByEmail(configs, altPort != "") // don't prompt user if server already running groupedConfigs := groupConfigsByEmail(configs, altPort != "") // don't prompt user if server already running

View file

@ -8,6 +8,7 @@ import (
"crypto/x509" "crypto/x509"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log"
"net" "net"
"net/http" "net/http"
"os" "os"
@ -346,6 +347,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
} else { } else {
w.WriteHeader(http.StatusNotFound) w.WriteHeader(http.StatusNotFound)
fmt.Fprintf(w, "No such host at %s", s.Server.Addr) fmt.Fprintf(w, "No such host at %s", s.Server.Addr)
log.Printf("[INFO] %s - No such host at %s", host, s.Server.Addr)
} }
} }