github mochi-mqtt/server v1.2.3

latest releases: v2.6.4, v2.6.3, v2.6.2...
2 years ago

What's Changed

Full Changelog: v1.2.2...v1.2.3


This release deprecates the Listener config.TLS value and instead exposes a new field, config.TLSConfig which takes a *tls.Config value.

Previously the setting of TLS certificates was handled by the broker, using config.TLS. However, this is a limiting approach, as it prevents users from configuring the TLS as they wish. Instead, the config.TLS field is deprecated, and we expose a new field, config.TLSConfig, which takes the *tls.Config value directly.

Old:

err := server.AddListener(tcp, &listeners.Config{
  Auth: new(auth.Allow),
  TLS: &listeners.TLS{
    Certificate: testCertificate,
    PrivateKey:  testPrivateKey,
  },
})

New:

cert, err := tls.X509KeyPair(testCertificate, testPrivateKey)

tlsConfig := &tls.Config{
  Certificates: []tls.Certificate{cert},
}

err = server.AddListener(tcp, &listeners.Config{
  Auth:      new(auth.Allow),
  TLSConfig: tlsConfig,
})

Don't miss a new server release

NewReleases is sending notifications on new releases.