You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Ignasi Barrera (JIRA)" <ji...@apache.org> on 2015/01/29 11:25:35 UTC
[jira] [Commented] (JCLOUDS-816) SSL error thrown while accessing
services through JCloud
[ https://issues.apache.org/jira/browse/JCLOUDS-816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14296666#comment-14296666 ]
Ignasi Barrera commented on JCLOUDS-816:
----------------------------------------
You have two options:
You can instruct jclouds to ignore all SSL verifications by setting the following properties and passing them to the {{ContextBuilder}} in the {{overrides}} method.
{code:java}
Properties props = new Properties();
props.put(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
props.put(Constants.PROPERTY_RELAX_HOSTNAME, "true");
{code}
Or even better, if you just want to trust your certificate, you have to provide your own {{SSLContext}} to jclouds. That should be populated with the certificates you trust, and with the appropriate {{HostnameVerifier}} and {{TrustManager}}, but the creation of the custom {{SSLContext}} is up to you. Once you have it, you can configure it as follows:
{code:java}
// Define the custom SSLContext supplier
Supplier<SSLContext> customSSLContext = new Supplier<SSLContext>() {
@Override
public SSLContext get() {
// Create here the custom SSLContext that trusts your certificates
}
};
// Create a Guice module that binds your custom SSLContext supplier
Module customSSLModule = new AbstractModule() {
@Override
protected void configure() {
bind(new TypeLiteral<Supplier<SSLContext>>() {}).toInstance(customSSLContext);
}
};
{code}
Once you have this you can add the {{customSSLModule}} to the list of modules you pass to the {{ContextBuilder}} and you should be done.
> SSL error thrown while accessing services through JCloud
> --------------------------------------------------------
>
> Key: JCLOUDS-816
> URL: https://issues.apache.org/jira/browse/JCLOUDS-816
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-compute
> Environment: HP Helion Cloud
> Reporter: Krishna Chaitanya
> Attachments: JCloudsNova_PubicCloud.out, JCloudsNova_PublicCloud.java, JCloudsNova_env5.java, JCloudsNova_env5.out
>
>
> While Creating a Context Builder using Jclouds NovaApi getting an SSL Error in HP Helion Cloud.
> This is working fine in HP public cloud.
> Please let me know the steps, how to enable SSL using ephemeralca-cacert.crt
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)