unioslo/nivlheim

Some machines get a new certificate every hour

Closed this issue · 0 comments

It seems that machines where the hostname hasn't been determined (the ones that show up as IP addresses), receive a new certificate every time they call in.

  1. Check if the selected hostname is an empty string here:
    https://github.com/usit-gd/nivlheim/blob/f7b76621af03207a058db8e510608f99cbf8184e/server/cgi/ping2#L55-L57
  2. The logic here is flawed, what if a row in hostinfo exists but hostname is empty or null: https://github.com/usit-gd/nivlheim/blob/f7b76621af03207a058db8e510608f99cbf8184e/server/cgi/renewcert#L90-L105
  3. At this point, http headers have already been output (on line 41):
    https://github.com/usit-gd/nivlheim/blob/f7b76621af03207a058db8e510608f99cbf8184e/server/cgi/renewcert#L72-L78
  4. Consider using osHostname here:
    https://github.com/usit-gd/nivlheim/blob/f7b76621af03207a058db8e510608f99cbf8184e/server/service/handleDNSchanges.go#L120-L125