Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8933

Add doPrivileged block to ProxyFactoryProxySelector.select() in HttpClientHTTPConduit

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0.3
    • 4.0.4
    • Transports
    • None
    • Unknown

    Description

      Then the security manager is enabled, there is AccessControlException thrown from HttpClientHTTPConduit. 

       Caused by: java.security.AccessControlException: Permission check failed (permission "("java.net.NetPermission" "getProxySelector")" 
         at java.base/java.net.ProxySelector.getDefault(ProxySelector.java:96)
         at org.apache.cxf.impl//org.apache.cxf.transport.http.HttpClientHTTPConduit$ProxyFactoryProxySelector.select(HttpClientHTTPConduit.java:330)
         at java.net.http/jdk.internal.net.http.HttpRequestImpl.retrieveProxy(HttpRequestImpl.java:287)
         at java.net.http/jdk.internal.net.http.HttpRequestImpl.<init>(HttpRequestImpl.java:133)
         at java.net.http/jdk.internal.net.http.HttpClientImpl.sendAsync(HttpClientImpl.java:603)
         at java.net.http/jdk.internal.net.http.HttpClientImpl.sendAsync(HttpClientImpl.java:586)
         at java.net.http/jdk.internal.net.http.HttpClientImpl.sendAsync(HttpClientImpl.java:578)
         at java.net.http/jdk.internal.net.http.HttpClientFacade.sendAsync(HttpClientFacade.java:129)
         at org.apache.cxf.impl//org.apache.cxf.transport.http.HttpClientHTTPConduit$HttpClientWrappedOutputStream.setProtocolHeaders(HttpClientHTTPConduit.java:534)
         at org.apache.cxf.impl//org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1373)
         at org.apache.cxf.impl//org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1409) 

      We need another doPrivileged block to fix this.

       

       

      Attachments

        Issue Links

          Activity

            People

              ema Jim Ma
              ema Jim Ma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: