Java – 407 cannot pass through proxy tunnel

We have a web service that calls a third - party web service To test this implementation, we have different environments

>Local developer machine: when we run the application, everything is normal, and our web service can access the third-party URL (the local machine uses Windows operating system) > local development server: after the application is deployed on the development server, we cannot access the third-party URL and get HTTP proxy 407 error (we are using Linux and IBM J9 JVM.)

To solve this problem, we try to set - dhttps proxyUser XXX -Dhttps. Proxypassword XXX, but we continue to receive errors The second option we tried was to use authenticator setDefault(new CustomImplAuthenticator()). Surprisingly, the JVM did not call getpasswordauthentication and continued to throw errors

We use authenticator The setDefault code runs the same application again on the local developer's computer We can access the URL as mentioned above, but this time the JVM does not call the getpasswordauthentication method After searching the network, we found that the authentication data was parsed through NTLM, so we think the code is running on windows

Anyone can let me know what settings, and we should configure the application deployed in the Linux box to call at least authenticator Implementation of setDefault allocation

Solution

It depends on how you establish your HTTP connection

Your implementation of HTTP calls needs to know about proxies

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>