You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Jesus arteche <ch...@gmail.com> on 2015/04/06 23:40:15 UTC

proxy

hey guys,

I'm using a proxy to access my private Opestack deployment, where the API
works on the IP range os 192.168.101.x. So I created  a proxy which maps a
public IP on a specific IP port to a specific private IP and port depending
on the API service.

How can I make my jClouds code work wthrough this proxy?

thanks

Re: proxy

Posted by Jesus arteche <ch...@gmail.com>.
I added these lines to my code

Properties overrides = new Properties();
overrides.setProperty(PROPERTY_PROXY_HOST, "169.x.x.x);
overrides.setProperty(PROPERTY_TRUST_ALL_CERTS, "true");

but I still being redirected after authentication to 192.168.101.10 (the
internal API  IP)

Apr 07, 2015 3:13:23 PM org.jclouds.logging.jdk.JDKLogger logError
SEVERE: Cannot retry after server error, command has exceeded retry limit
5: [method=org.jclouds.openstack.nova.v2_0.features.ServerApi.public
abstract org.jclouds.collect.PagedIterable
org.jclouds.openstack.nova.v2_0.features.ServerApi.listInDetail()[],
request=GET
https://192.168.101.10:8774/v2/7d5df21bfb0942cfaf048b0fxxxxxxxx/servers/detail
HTTP/1.1]
Exception in thread "main" org.jclouds.http.HttpResponseException: connect
timed out connecting to GET
https://192.168.101.10:8774/v2/7d5df21bfb0942cfafxxxxx/servers/detail
HTTP/1.1
at
org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:110)
at
org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
at
org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
at
org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
at
org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
at
com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
at com.sun.proxy.$Proxy64.listInDetail(Unknown Source)
at icos.JCloudsNovaIBM.<init>(JCloudsNovaIBM.java:65)
at icos.JCloudsNovaIBM.main(JCloudsNovaIBM.java:25)
Caused by: java.net.SocketTimeoutException: connect timed out
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:85)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:541)
at
sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1687)
at
sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1685)
at java.security.AccessController.doPrivileged(AccessController.java:330)
at
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1683)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1256)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:479)
at com.ibm.net.ssl.www2.protocol.https.b.getResponseCode(b.java:91)
at
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.invoke(JavaUrlHttpCommandExecutorService.java:110)
at
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.invoke(JavaUrlHttpCommandExecutorService.java:71)
at
org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:89)
... 8 more
Caused by: java.net.SocketTimeoutException: connect timed out
at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:369)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
at java.net.Socket.connect(Socket.java:642)
at com.ibm.jsse2.qc.connect(qc.java:365)
at sun.net.NetworkClient.doConnect(NetworkClient.java:187)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:461)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:556)
at com.ibm.net.ssl.www2.protocol.https.c.<init>(c.java:51)
at com.ibm.net.ssl.www2.protocol.https.c.a(c.java:50)
at com.ibm.net.ssl.www2.protocol.https.d.getNewHttpClient(d.java:12)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:987)
at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:42)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1312)
at com.ibm.net.ssl.www2.protocol.https.b.getInputStream(b.java:8)
at
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.invoke(JavaUrlHttpCommandExecutorService.java:102)
... 10 more


any idea?

On Tue, Apr 7, 2015 at 12:10 AM, Ignasi Barrera <na...@apache.org> wrote:

> You can configure the proxy properties when creating the jclouds
> context. Have a look at the PROPERTY_PROXY* properties here:
>
> http://jclouds.apache.org/reference/javadoc/1.9.x/constant-values.html#org.jclouds.Constants.PROPERTY_PROXY_HOST
>
> HTH!
>
> Ignasi
>
> On 6 April 2015 at 23:40, Jesus arteche <ch...@gmail.com> wrote:
> > hey guys,
> >
> > I'm using a proxy to access my private Opestack deployment, where the API
> > works on the IP range os 192.168.101.x. So I created  a proxy which maps
> a
> > public IP on a specific IP port to a specific private IP and port
> depending
> > on the API service.
> >
> > How can I make my jClouds code work wthrough this proxy?
> >
> > thanks
>

Re: proxy

Posted by Ignasi Barrera <na...@apache.org>.
You can configure the proxy properties when creating the jclouds
context. Have a look at the PROPERTY_PROXY* properties here:
http://jclouds.apache.org/reference/javadoc/1.9.x/constant-values.html#org.jclouds.Constants.PROPERTY_PROXY_HOST

HTH!

Ignasi

On 6 April 2015 at 23:40, Jesus arteche <ch...@gmail.com> wrote:
> hey guys,
>
> I'm using a proxy to access my private Opestack deployment, where the API
> works on the IP range os 192.168.101.x. So I created  a proxy which maps a
> public IP on a specific IP port to a specific private IP and port depending
> on the API service.
>
> How can I make my jClouds code work wthrough this proxy?
>
> thanks