Add more dev config tests

This commit is contained in:
Arthur Barr
2018-03-21 13:40:53 +00:00
parent 0e71468826
commit fcb7377575
3 changed files with 106 additions and 49 deletions

View File

@@ -117,15 +117,16 @@ func configureTLS(qmName string, inputFile string, passPhrase string) error {
return err
}
f, err := os.OpenFile("/etc/mqm/20-dev-tls.mqsc", os.O_WRONLY|os.O_CREATE, 0770)
if err != nil {
return err
}
defer f.Close()
// Change the Queue Manager's Key Repository to point at the new TLS key store
fmt.Fprintf(f, "ALTER QMGR SSLKEYR('%s')\n", filepath.Join(dir, "key"))
fmt.Fprintf(f, "ALTER QMGR CERTLABL('%s')\n", newLabel)
if os.Getenv("MQ_DEV") == "true" {
f, err := os.OpenFile("/etc/mqm/20-dev-tls.mqsc", os.O_WRONLY|os.O_CREATE, 0770)
if err != nil {
return err
}
defer f.Close()
// Change the Queue Manager's Key Repository to point at the new TLS key store
fmt.Fprintf(f, "ALTER QMGR SSLKEYR('%s')\n", filepath.Join(dir, "key"))
fmt.Fprintf(f, "ALTER QMGR CERTLABL('%s')\n", newLabel)
// Alter the DEV channels to use TLS
fmt.Fprintln(f, "ALTER CHANNEL('DEV.APP.SVRCONN') CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256) SSLCAUTH(OPTIONAL)")
fmt.Fprintln(f, "ALTER CHANNEL('DEV.ADMIN.SVRCONN') CHLTYPE(SVRCONN) SSLCIPH(TLS_RSA_WITH_AES_128_CBC_SHA256) SSLCAUTH(OPTIONAL)")