|
|
@@ -14,6 +14,7 @@ import (
|
|
|
"time"
|
|
|
|
|
|
"github.com/syncthing/syncthing/lib/protocol"
|
|
|
+ "github.com/syncthing/syncthing/lib/tlsutil"
|
|
|
"github.com/thejerf/suture"
|
|
|
)
|
|
|
|
|
|
@@ -86,7 +87,11 @@ func main() {
|
|
|
if !useHTTP {
|
|
|
cert, err = tls.LoadX509KeyPair(certFile, keyFile)
|
|
|
if err != nil {
|
|
|
- log.Fatalln("Failed to load X509 key pair:", err)
|
|
|
+ log.Println("Failed to load keypair. Generating one, this might take a while...")
|
|
|
+ cert, err = tlsutil.NewCertificate(certFile, keyFile, "stdiscosrv", 3072)
|
|
|
+ if err != nil {
|
|
|
+ log.Fatalln("Failed to generate X509 key pair:", err)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
devID := protocol.NewDeviceID(cert.Certificate[0])
|