summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-05-23 14:43:17 +0200
committerJakob Borg <jakob@nym.se>2014-05-23 14:43:17 +0200
commit963078f6ac4555d04e8d8a5e5417772a033bcd2b (patch)
treeca87eaf7d485ebacaec324fbcb03d5cc57cf7130 /cmd
parent8356b58b1ddda7b76f64d95bc11b8c3ae0cc759a (diff)
Don't reuse certificate serials
Diffstat (limited to 'cmd')
-rw-r--r--cmd/syncthing/tls.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/syncthing/tls.go b/cmd/syncthing/tls.go
index fc3cb53558..148033d544 100644
--- a/cmd/syncthing/tls.go
+++ b/cmd/syncthing/tls.go
@@ -11,6 +11,7 @@ import (
"encoding/binary"
"encoding/pem"
"math/big"
+ mr "math/rand"
"os"
"path/filepath"
"strings"
@@ -50,7 +51,7 @@ func newCertificate(dir string, prefix string) {
notAfter := time.Date(2049, 12, 31, 23, 59, 59, 0, time.UTC)
template := x509.Certificate{
- SerialNumber: new(big.Int).SetInt64(0),
+ SerialNumber: new(big.Int).SetInt64(mr.Int63()),
Subject: pkix.Name{
CommonName: tlsName,
},