What's Changed
- Add CleanSession and Username to events.Client struct by @mochi-co in #82 as per #81
- Expose tls.Config to Listeners by @mochi-co in #83 as per #79
- Goreport fixes by @mochi-co in #84
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,
})