Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove test for invalid client auth #74

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions tls_connections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,37 +260,3 @@ func TestAnonConfigToMutualTLSConnectionFails(t *testing.T) {
assert.Equal(t, "2393", errCtx.GetErrorCode())

}

/*
* Test that we get an error code when we give an invalid value for the
* TLSClientAuth parameter.
*/
func TestInvalidClientAuthValue(t *testing.T) {

cf, err := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
assert.Nil(t, err)

// Override the connection settings to point to the anonymous ("one way") TLS
// channel (must be configured on the queue manager)
cf.ChannelName = "TLS.ANON.SVRCONN"

// Set the channel settings that tells the client what TLS configuration to use
// to connect to the queue manager.
cf.TLSCipherSpec = "ANY_TLS12"
cf.TLSClientAuth = "INVALID_VALUE!"
cf.KeyRepository = "./tls-samples/anon-tls" // points to .kdb file

// Creates a connection to the queue manager, using defer to close it automatically
// at the end of the function (if it was created successfully)
context, errCtx := cf.CreateContext()
if context != nil {
defer context.Close()
}

assert.NotNil(t, errCtx)
if errCtx != nil {
assert.Equal(t, "MQRC_CD_ERROR", errCtx.GetReason())
assert.Equal(t, "2277", errCtx.GetErrorCode())
}

}