Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

https.proxy not respected #55

Open
prasad-1210 opened this issue Jun 24, 2020 · 1 comment
Open

https.proxy not respected #55

prasad-1210 opened this issue Jun 24, 2020 · 1 comment
Assignees

Comments

@prasad-1210
Copy link

We are running behind a corporate proxy and unable to connect to ibm cloud.

here is how we set our Proxy settings while starting tomcat
java -Dhttps.proxyHost=10.4.XX.XX -Dhttps.proxyPort=8080 -Dhttps.nonProxyHosts=*.local|localhost ... org.apache.catalina.startup.Bootstrap start

First we printing system properties:
log("https.proxyHost: " + System.getProperty('https.proxyHost')+ "\nhttps.proxyPost" + System.getProperty('https.proxyPort')+ \nhttps.nonProxyHosts"+ System.getProperty('https.nonProxyHosts'));

====> This prints proxy details correctly.

Here is how we invoke push method:
PuhNotifications.send(notification, listener)

====> This throws
c.i.m.s.java.push.PushNotifications [180] : java.net.UnknownHostException: iam.cloud.ibm.com: Name or service not know
.....
PushServerSDKException: FPSDK0004A: Error in fetching service access token
...

Possible fix:
https://github.com/ibm-bluemix-mobile-services/bms-pushnotifications-serversdk-java/blob/master/src/main/java/com/ibm/mobilefirstplatform/serversdk/java/push/PushNotifications.java#L338

HttpClient should be built with system properties

- httpClient = HttpClients.custom().setSSLContext(sslContext).build();
+ httpClient = HttpClients.custom().useSystemProperties().setSSLContext(sslContext).build(); 

Please advise.

@myselfneerav
Copy link
Member

Hi @prasad-1210 ,

It seems like your firewall might be blocking outbound access to the endpoint .
Please check your firewall and proxy settings.

@myselfneerav myselfneerav self-assigned this Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants