[ 
https://issues.apache.org/jira/browse/JCLOUDS-1287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15994641#comment-15994641
 ] 

Ignasi Barrera commented on JCLOUDS-1287:
-----------------------------------------

We need to determine if that is a driver-specific issue or not, and as far as I 
can see in the code, it looks like it is, so we need confirmation.

What SSL issues are you experiencing? With the OkHttp driver you can easily 
configure HTTPS by providing a customized OkHtto client. For example you could 
preconfigure the client to use TLS as follows, and then pass the Guice module 
to the list of modules used to create the context:

{code:java}
class TLSOkHttpClientSupplier implements OkHttpClientSupplier {
   @Override
   public OkHttpClient get() {
      OkHttpClient client = new OkHttpClient();
      ConnectionSpec tlsSpec = new 
ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
         .tlsVersions(TlsVersion.TLS_1_0, TlsVersion.TLS_1_1, 
TlsVersion.TLS_1_2)
         .build();
      ConnectionSpec cleartextSpec = new 
ConnectionSpec.Builder(ConnectionSpec.CLEARTEXT).build();
      client.setConnectionSpecs(ImmutableList.of(tlsSpec, cleartextSpec));
      return client;
   }
}

Module tlsModule = new AbstractModule() {
   @Override
   protected void configure() {
      bind(OkHttpClientSupplier.class).to(TLSOkHttpClientSupplier.class);
   }
};


{code}

> Custom/Default configuration for Connection/SO/Request Timeout properties are 
> not working as expected using overrides()
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCLOUDS-1287
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1287
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-core
>    Affects Versions: 1.8.1
>            Reporter: Pavan Vadavi
>              Labels: Configuration
>
> I am using overrides method to set the following timeout properties. But 
> timeout is not happening in 30 secs. I understand that the default values for 
> these properties is 60 secs. But timeout happening after almost 300 secs.
> I also understand that these proeprties have to be set in millisecs. So 
> method CommonUtil.getTimeOutInMilliSeconds() returns 30000.
> return ContextBuilder.newBuilder(providerOrAPI)
>                 .endpoint(getEndPointUrl(osLogin))
>                 .modules(getModules())
>                 .overrides(getOverrides())
>                 .credentials(osLogin.getTenantName() + CBVnfmConstants.COLON 
> + osLogin.getUserName(),
>                         osLogin.getPassword())
>                 .buildApi(type);
> private Properties getOverrides() {
>         Properties overrides = new Properties();
>         overrides.setProperty(Constants.PROPERTY_SO_TIMEOUT, 
> CommonUtil.getTimeOutInMilliSeconds() + "");
>         overrides.setProperty(Constants.PROPERTY_CONNECTION_TIMEOUT, 
> CommonUtil.getTimeOutInMilliSeconds() + "");
>         overrides.setProperty(Constants.PROPERTY_REQUEST_TIMEOUT, 
> CommonUtil.getTimeOutInMilliSeconds() + "");
>         return overrides;
>     }
> private Set<? extends Module> getModules() {
>         Set<? extends Module> modules = ImmutableSet.of(new 
> ApacheHCHttpCommandExecutorServiceModule(), new Log4JLoggingModule());
>         return modules;
>     }



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to