Properties overrides = new Properties();
overrides.put(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
overrides.put(Constants.PROPERTY_RELAX_HOSTNAME, "true");
overrides.put("jclouds.cloudstack.credential-type", "passwordCredentials");
context = ContextBuilder.newBuilder(new CloudStackApiMetadata())
.endpoint(checkNotNull(endpoint, "endpoint").toASCIIString())
.credentials(String.format("%s/%s", checkNotNull(domain, "domain"), checkNotNull(username, "username")), password)
.overrides(overrides).build(CloudStackContext.class);
CloudStackClient client = context.unwrap(CloudStackApiMetadata.CONTEXT_TOKEN).getApi();