Skip to content

Commit

Permalink
Use the same server as in addr for NTP.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchackorg committed Dec 11, 2018
1 parent 5d0da97 commit a59c3ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/client.go
Expand Up @@ -4,6 +4,7 @@ import (
"crypto/tls"
"flag"
"fmt"
"strings"

"../ntske"
"github.com/beevik/ntp"
Expand Down Expand Up @@ -60,7 +61,10 @@ func main() {

fmt.Printf("NTS-KE negotiated data: %#v\n", ke.Meta)

ntpTime, err := ntp.Time("localhost")
// TODO use the negotiated NTP server in ke.Meta.Server if any
addrNoPort := addr[:strings.IndexByte(addr, ':')]

ntpTime, err := ntp.Time(addrNoPort)
if err != nil {
fmt.Println(err)
}
Expand Down

0 comments on commit a59c3ff

Please sign in to comment.