Skip to content

Commit

Permalink
remove debugging statements and old code
Browse files Browse the repository at this point in the history
  • Loading branch information
did committed Nov 1, 2024
1 parent 2825c98 commit 2a30eb8
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions internal/server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,37 +322,6 @@ func (s *Service) createCertManager(hosts []string, options ServiceOptions) (Cer
}
}

// // TODO:
// // - create a func instead to return the host policy
// // - create the function calling the on demand url
// var hostPolicy = autocert.HostWhitelist(hosts...)

// // https://stackoverflow.com/questions/52129908/can-i-have-a-dynamic-host-policty-with-autocert

// // Wildcard hosts!!! we can handle them now!
// if len(hosts) == 0 && options.TLSOnDemandUrl != "" {
// fmt.Println("πŸš€πŸš€πŸš€ Registering a custom hostPolicy for", hosts)
// hostPolicy = func(ctx context.Context, host string) error {
// slog.Debug("Contacting", options.TLSOnDemandUrl, host)

// resp, err := http.Get(fmt.Sprintf("%s?domain=%s", options.TLSOnDemandUrl, url.QueryEscape(host)))

// if err != nil {
// // the TLS on demand URL is not reachable
// slog.Error("Unable to reach the TLS on demand URL", host, err)
// return err
// }

// if resp.StatusCode != 200 && resp.StatusCode != 201 {
// return fmt.Errorf("%s is not allowed to get a certificate", host)
// }

// return nil
// }
// } else {
// fmt.Println("πŸ˜•πŸ˜•πŸ˜•", len(hosts), hosts, options.TLSOnDemandUrl)
// }

hostPolicy, err := s.createAutoCertHostPolicy(hosts, options)

if err != nil {
Expand Down

0 comments on commit 2a30eb8

Please sign in to comment.