It seems that currently it's not possible to use a callback for fetching TLS certificates on the fly. It's useful for hot replacement of certificates without a need of an application restart. That might be possibly by providing a GetCertificate callback via the tls.Config input of the Server. But the issue is that the ListenAndServeTLS(certFile, keyFile string) unconditionally fills config.Certificates and fails if the certificate files are missing. This can be fixed by means of adding an option into ListenAndServeTLS to skip the lines:
https://github.com/fiorix/go-diameter/blob/master/diam/server.go#L697
It seems that currently it's not possible to use a callback for fetching TLS certificates on the fly. It's useful for hot replacement of certificates without a need of an application restart. That might be possibly by providing a GetCertificate callback via the tls.Config input of the Server. But the issue is that the
ListenAndServeTLS(certFile, keyFile string)
unconditionally fills config.Certificates and fails if the certificate files are missing. This can be fixed by means of adding an option into ListenAndServeTLS to skip the lines: https://github.com/fiorix/go-diameter/blob/master/diam/server.go#L697Or it might check if the config.GetCertificate is nil and load certificates only in that case.