javapns-jdk16 icon indicating copy to clipboard operation
javapns-jdk16 copied to clipboard

Using Credentials with Proxy Servers

Open patanderson opened this issue 8 years ago • 4 comments

I'm using your wonderful library and trying to add proxy server support into my code. JavaPNS seems to work fine against a proxy server that does not require authentication, but does not seem able to pass credentials to a proxy server that requires authentication.

I've searched around and found an instance of your ProxyManager that has the following method: ProxyManager.setProxyBasicAuthorization(username, password);

The problem is that that appears only in a beta release. https://github.com/azinman/javapns/blob/master/JavaPNS_2.3_Beta_2.jar?raw=true

I do not see that method on any release I find on the maven site. Was this functionality removed?

I have tried to do it manually in my code by setting the "javapns.communication.proxyAuthorization" System property, but it doesn't seem to make a difference.

What should I do to work with a proxy server that requires authentication?

-pat

patanderson avatar Feb 15 '17 20:02 patanderson

Hi @patanderson,

ProxyManager is a public class, you should be able to use it.

Example:

ProxyManager.setProxy("myProxy", "myPort");

fernandospr avatar Feb 15 '17 20:02 fernandospr

I'm obtaining your library from here: https://mvnrepository.com/artifact/com.github.fernandospr/javapns-jdk16

All versions are missing the ProxyManager.setProxyBasicAuthorization() method.

Is there another way to set the authorization credentials?

-pat

patanderson avatar Feb 15 '17 20:02 patanderson

Oh, now I see what you mean. This repository was forked from code.google.com, it seems the Proxy authentication was not completed. I've seen that this fork seems to have it implemented: https://github.com/azinman/javapns/blob/master/src/javapns/communication/ProxyManager.java

Unfortunately, I'm not able to test it. If you want you can just use that fork or submit a pull request and I'll be happy to include it on this fork.

fernandospr avatar Feb 15 '17 20:02 fernandospr

Hi @fernandospr Please confirm if the Proxy authentication is completed now or not. ProxyManager.setProxyBasicAuthorization(username, password) Method is still not available in javapns-jdk16-2.4.0.jar (which in maven seems to be the latest version).

ruchikasa avatar Aug 10 '18 09:08 ruchikasa