amqp-node / amqplib

AMQP 0-9-1 library and client for Node.JS

Home Page:https://amqp-node.github.io/amqplib/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do not copy hostname to socket options servername (server name indication)

urbanhusky opened this issue · comments

RFC 6066 specifies that the Server Name Indication must not be an IP address.
Unfortunately amqplib blindly copies the hostname from the url to this field, which causes DEP0123 warnings when connecting to an IP address.
Besides, the hostname is not necessarily identical to the server name indication, so it should be configurable e.g. via the socketOptions provided to connect(…)

Source:
https://github.com/amqp-node/amqplib/blob/main/lib/connect.js#L109
https://datatracker.ietf.org/doc/html/rfc6066#section-3

Hi @urbanhusky,
Thanks for reporting. I agree.

Published as amqplib@0.10.1