Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1332

NPE in HttpServletRequestImpl.getLocalAddr()

    XMLWordPrintable

Details

      • Set up WildFly 12 behind a reverse proxy,
      • Enable proxy-address-forwarding attribute on the http-listener,
      • Ensure the RP sends X-Forwarded-Host header,
      • the application calls down to getLocalAddr

    Description

      If the following circumstances are all present:

      • WildFly 12 sits behind a reverse proxy,
      • The proxy-address-forwarding attribute is set to true for the http-listener,
      • The reverse proxy sends X-Forwarded-Host header,
      • and there is a call to getLocalAddr

      The following NPE can be seen:

      Caused by: java.lang.NullPointerException
      	at io.undertow.servlet.spec.HttpServletRequestImpl.getLocalAddr(HttpServletRequestImpl.java:999)
      	at org.forgerock.http.servlet.HttpFrameworkServlet.createClientContext(HttpFrameworkServlet.java:320)
      	at org.forgerock.http.servlet.HttpFrameworkServlet.service(HttpFrameworkServlet.java:252)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
      

      Attachments

        Issue Links

          Activity

            People

              sdouglas1@redhat.com Stuart Douglas
              aldaris88 Peter Major (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: