rabbitmq / rabbitmq-stream-go-client

A client library for RabbitMQ streams
MIT License
170 stars 20 forks source link

When SSL certificate is specified, no user name and password need to be set. #207

Closed flykos closed 1 year ago

flykos commented 1 year ago

Describe the bug

Currently, if I don't set a username and password, it will be populated with the default username and password, which is guest:guest. However, when an SSL certificate is specified, the user name and password are not required. So in this case, username and password can be omitted.

Reproduction steps

  1. Start a RabbitMQ instance with SSL support.

  2. Create an environment with code similar to the following,not need to specify username and password.

tlsEnv, tlsErr := stream.NewEnvironment(stream.NewEnvironmentOptions().
        SetUri("rabbitmq-stream+tls://localhost:5551/vhost_gpss").
        IsTLS(true).
        SetTLSConfig(tlsConf))
  1. Running the code will result in an error Authentication Failure

Expected behavior

When an SSL certificate is set, there is no need to specify a user name and password.

Additional context

There is a method in amqp091-go to access with an SSL certificate which is DialTLS_ExternalAuth.

I think the two should be similar.

Gsantomaggio commented 1 year ago

The client adds the default values when not specified. I'd add a flag to ignore the default values