Uploaded image for project: 'JBoss Remoting (3+)'
  1. JBoss Remoting (3+)
  2. REM3-189

HttpUpgradeConnectionProvider#createConnection fails for loopback addresses

    XMLWordPrintable

Details

    Description

      HttpUpgradeConnectionProvider#createConnection creates an URI based on a given SocketAddress and the result of getHostName(). If the given SocketAddress is a loopback address – for example 127.254.254.254getHostName() will return the machine's host name. XNIO will use the host part of this URI to establish a connection and fails because the machine's host name resolves to a different IP address.

      Changing the construction of the URI from

      new URI("http", "", destination.getHostName(), destination.getPort(), "/", "", "")
      

      to

      new URI("http", "", destination.getAddress().getHostAddress(), destination.getPort(), "/", "", "")
      

      will construct an URI based on an IP address and solve this issue.

      Attachments

        Activity

          People

            dlloyd@redhat.com David Lloyd
            systemtrap Matthias Berndt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: