-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Describe the bug
when use github.com/rabbitmq/rabbitmq-amqp-go-client connect RabbitMQ server failed by ssl, the error contains message like this ERROR Failed to open connection amqps://guest@*****192.168.2.104:5671/="dial tcp 192.168.2.104:5671: connect: operation timed out. but when client connect RabbitMQ server,there is no username and password in protocol,just amqps://192.168.2.104:5671. when track the source of error message,
found error message from this func NewConnection in this file github.com/rabbitmq/[email protected]/pkg/rabbitmqamqp/amqp_environment.go.this error message is reported when the Dial func fails to be called in NewConnection func. use this ExtractWithoutPassword func to parse address info when outputing error message. in this ExtractWithoutPassword func,when parses the URI information, a default structure is defined, and the parameters in this structure are continuously assigned and returned.
but there is no separate handling of amqps protocol conditions when ExtractWithoutPassword end. only use return u.Scheme + "://" + u.Username + "@*****" + u.Host + ":" + strconv.Itoa(u.Port) + u.Vhost output uri info by all conditions.
Reproduction steps
- use tls-gen generate ssl file
- add ssl config into rabbitmq.conf
- add client ssl file parse
- use amqps protocol to connect server
Expected behavior
expected error message like this ERROR Failed to open connection amqps://192.168.2.104:5671/
Additional context
- go version 1.24
- rabbitmq-amqp-go-client v0.1.1