diff --git a/dm/config/security/security.go b/dm/config/security/security.go index 4ec521d23eb..84143fab0ae 100644 --- a/dm/config/security/security.go +++ b/dm/config/security/security.go @@ -103,15 +103,15 @@ func (s *Security) Clone() *Security { return &clone } -func (s *Security) WriteFiles(name string) error { +func (s *Security) WriteFiles(fileName string) error { var err error - if s.SSLCA, err = certificate.WriteFile(fmt.Sprintf("%s_ca.pem", name), s.SSLCABytes); err != nil { + if s.SSLCA, err = certificate.WriteFile(fileName, s.SSLCABytes); err != nil { return err } - if s.SSLCert, err = certificate.WriteFile(fmt.Sprintf("%s_dm.pem", name), s.SSLCertBytes); err != nil { + if s.SSLCert, err = certificate.WriteFile(fileName, s.SSLCertBytes); err != nil { return err } - if s.SSLKey, err = certificate.WriteFile(fmt.Sprintf("%s_dm.key", name), s.SSLKeyBytes); err != nil { + if s.SSLKey, err = certificate.WriteFile(fileName, s.SSLKeyBytes); err != nil { return err } return nil