String servicePath = RegistryResources.SERVICE_GROUPS
+ axisService.getAxisServiceGroup().getServiceGroupName()
+ RegistryResources.SERVICES + axisService.getName();
Resource serviceResource = registry.get(servicePath);
Association[] assoc = registry.getAssociations(servicePath, RegistryResources.Associations.PRIVATE_KEYSTORE);
KeyStoreManager keyStoreManager = KeyStoreManager.getInstance(null);
KeyStore keyStore = null;
if(assoc.length < 1){
boolean httpsEnabled = false;
Association[] associations =
registry.getAssociations(servicePath, RegistryResources.Associations.EXPOSED_TRANSPORTS);
for (Association association : associations) {
Resource resource = registry.get(association.getDestinationPath());
String transportProtocol = resource.getProperty(RegistryResources.Transports.PROTOCOL_NAME);
if(transportProtocol.equals("https")){
httpsEnabled = true;
break;
}
resource.discard();
}
if (httpsEnabled ||Boolean.valueOf(serviceResource.getProperty(RegistryResources.ServiceProperties.EXPOSED_ON_ALL_TANSPORTS))) {
keyStore = keyStoreManager.getPrimaryKeyStore();
}