Version 3.0.1 and 3.0.2 does not work with "UntrustedSSL" context #895

Open
olivier-schmitt opened this Issue Nov 23, 2016 · 6 comments

Projects

None yet

5 participants

@olivier-schmitt

Hello,

This code :

Config config = Config.DEFAULT;
config.withSSLContext(UntrustedSSL.getSSLContext());
IOSClientBuilder.V2 v2 = OSFactory.builderV2()
.endpoint(endpoint)
.credentials(
userName,
password)
.tenantName(tenantName)
.withConfig(config);
return v2.authenticate();

Works fine with 3.0.0 but does not work with 3.0.1 & 3.0.2 :

Exception in thread "main" ConnectionException{message=peer not authenticated, status=0}
at org.openstack4j.connectors.resteasy.HttpExecutorServiceImpl.invoke(HttpExecutorServiceImpl.java:56)
at org.openstack4j.connectors.resteasy.HttpExecutorServiceImpl.execute(HttpExecutorServiceImpl.java:30)
at org.openstack4j.core.transport.internal.HttpExecutor.execute(HttpExecutor.java:51)
at org.openstack4j.openstack.internal.OSAuthenticator.authenticateV2(OSAuthenticator.java:122)
at org.openstack4j.openstack.internal.OSAuthenticator.invoke(OSAuthenticator.java:52)
at org.openstack4j.openstack.client.OSClientBuilder$ClientV2.authenticate(OSClientBuilder.java:117)
at org.openstack4j.openstack.client.OSClientBuilder$ClientV2.authenticate(OSClientBuilder.java:79)

Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:431)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:397)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor.execute(ApacheHttpClient4Executor.java:182)
at org.jboss.resteasy.client.ClientRequest.execute(ClientRequest.java:438)
at org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:688)
at org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:694)
at org.openstack4j.connectors.resteasy.HttpCommand.execute(HttpCommand.java:65)
at org.openstack4j.connectors.resteasy.HttpExecutorServiceImpl.invokeRequest(HttpExecutorServiceImpl.java:61)
at org.openstack4j.connectors.resteasy.HttpExecutorServiceImpl.invoke(HttpExecutorServiceImpl.java:54)

Thanks.
PS: OpenStack4J is awesome, thanks for the good job.

@zhoutiekui

We have encountered the same error.

@OpenStacksh

@olivier-schmitt Hi, I have the same problem just like you when i use version 3.0.2. do you have solve the problem?can you give me some advise. Thanks

@olivier-schmitt

Hi, i use version 3.0.0 without bugs for now.

@m-kochaji

@olivier-schmitt Hi, this might be related to this Config caching issue - #913

You can find out by modifying other parameters in the config such as the max connections (choose something arbitrary like: config.withMaxConnections(7370)

@olivier-schmitt

I does not have any effect on my problem.

@auhlig
Member
auhlig commented Jan 5, 2017 edited

Sorry for missing the issue. Not sure what relevant parts changed from 3.0.0 to 3.0.2.
Worht trying a different connector. @olivier-schmitt
Maybe it's only related to resteasy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment