diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 22eb1c56c..b1bf33af7 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -620,6 +620,10 @@ func syncthingMain(runtimeOptions RuntimeOptions) { InsecureSkipVerify: true, MinVersion: tls.VersionTLS12, CipherSuites: []uint16{ + 0xCCA8, // TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, Go 1.8 + 0xCCA9, // TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, Go 1.8 + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, diff --git a/lib/connections/service.go b/lib/connections/service.go index 527f39c43..43baab79e 100644 --- a/lib/connections/service.go +++ b/lib/connections/service.go @@ -41,6 +41,32 @@ const ( tlsHandshakeTimeout = 10 * time.Second ) +// From go/src/crypto/tls/cipher_suites.go +var tlsCipherSuiteNames = map[uint16]string{ + 0x0005: "TLS_RSA_WITH_RC4_128_SHA", + 0x000a: "TLS_RSA_WITH_3DES_EDE_CBC_SHA", + 0x002f: "TLS_RSA_WITH_AES_128_CBC_SHA", + 0x0035: "TLS_RSA_WITH_AES_256_CBC_SHA", + 0x003c: "TLS_RSA_WITH_AES_128_CBC_SHA256", + 0x009c: "TLS_RSA_WITH_AES_128_GCM_SHA256", + 0x009d: "TLS_RSA_WITH_AES_256_GCM_SHA384", + 0xc007: "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", + 0xc009: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + 0xc00a: "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + 0xc011: "TLS_ECDHE_RSA_WITH_RC4_128_SHA", + 0xc012: "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", + 0xc013: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + 0xc014: "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + 0xc023: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + 0xc027: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + 0xc02f: "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + 0xc02b: "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + 0xc030: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + 0xc02c: "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + 0xcca8: "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", + 0xcca9: "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", +} + // Service listens and dials all configured unconnected devices, via supported // dialers. Successful connections are handed to the model. type Service struct { @@ -272,8 +298,7 @@ next: protoConn := protocol.NewConnection(remoteID, rd, wr, s.model, name, deviceCfg.Compression) modelConn := completeConn{c, protoConn} - l.Infof("Established secure connection to %s at %s", remoteID, name) - l.Debugf("cipher suite: %04X in lan: %t", c.ConnectionState().CipherSuite, !limit) + l.Infof("Established secure connection to %s at %s (%s)", remoteID, name, tlsCipherSuiteNames[c.ConnectionState().CipherSuite]) s.model.AddConnection(modelConn, hello) s.curConMut.Lock()