Rasika Perera 7 years ago
commit 32dcc3be6c

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>androidsense-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -3,7 +3,7 @@
<parent>
<artifactId>androidsense-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>androidsense-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -75,6 +75,7 @@ var rotation_yData = [];
var rotation_zData = [];
var graphMap = {};
var graphSettingsMap = {};
var palette = new Rickshaw.Color.Palette({scheme: "munin"});
@ -318,6 +319,7 @@ function disconnect() {
}
function maximizeGraph(graph, width,height){
graphSettingsMap[graph.element.id] = {'width': graph.width, 'height': graph.height};
graph.configure({
width: width*2,
height: height*2
@ -327,9 +329,10 @@ function maximizeGraph(graph, width,height){
}
function minimizeGraph(graph){
var graphSettings = graphSettingsMap[graph.element.id];
graph.configure({
width: 366,
height: 300
width: graphSettings.width,
height: graphSettings.height
});
graph.update();
}

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>arduino-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>arduino-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<artifactId>arduino-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -30,10 +30,7 @@
</div>
<a class="padding-left"
href="{{@app.context}}/device/{{device.type}}/analytics?deviceId={{device.deviceIdentifier}}&deviceName={{device.name}}">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-statistics fw-stack-1x"></i>
</span> View Device Analytics
<span class="fw-stack"> <i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw fw-statistics fw-stack-1x"></i> <span class="fw-stack fw-move-right fw-move-bottom"> <i class="fw fw-circle fw-stack-2x fw-stroke"></i> <i class="fw fw-clock fw-stack-1x fw-inverse"></i> </span> </span> View Device Analytics
</a>
<!-- /statistics -->
{{#zone "bottomJs"}}

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>raspberrypi-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>raspberrypi-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<artifactId>raspberrypi-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -30,10 +30,7 @@
</div>
<a class="padding-left"
href="{{@app.context}}/device/{{device.type}}/analytics?deviceId={{device.deviceIdentifier}}&deviceName={{device.name}}">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-statistics fw-stack-1x"></i>
</span> View Device Analytics
<span class="fw-stack"> <i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw fw-statistics fw-stack-1x"></i> <span class="fw-stack fw-move-right fw-move-bottom"> <i class="fw fw-circle fw-stack-2x fw-stroke"></i> <i class="fw fw-clock fw-stack-1x fw-inverse"></i> </span> </span> View Device Analytics
</a>
<!-- /statistics -->
{{#zone "bottomJs"}}

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -30,10 +30,7 @@
</div>
<a class="padding-left"
href="{{@app.context}}/device/{{device.type}}/analytics?deviceId={{device.deviceIdentifier}}&deviceName={{device.name}}">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-statistics fw-stack-1x"></i>
</span> View Device Analytics
<span class="fw-stack"> <i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw fw-statistics fw-stack-1x"></i> <span class="fw-stack fw-move-right fw-move-bottom"> <i class="fw fw-circle fw-stack-2x fw-stroke"></i> <i class="fw fw-clock fw-stack-1x fw-inverse"></i> </span> </span> View Device Analytics
</a>
<!-- /statistics -->
{{#zone "bottomJs"}}

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -18,7 +18,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>appm-connector</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -18,7 +18,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>appm-connector</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -67,6 +67,7 @@
feign.gson,
org.json.simple.*,
org.wso2.carbon.appmgt.mobile.beans,
org.wso2.carbon.base,
org.wso2.carbon.context,
javax.net.ssl,
feign.slf4j

@ -47,17 +47,15 @@ import org.wso2.carbon.appmgt.mobile.mdm.App;
import org.wso2.carbon.appmgt.mobile.mdm.Device;
import org.wso2.carbon.appmgt.mobile.utils.MobileApplicationException;
import org.wso2.carbon.appmgt.mobile.utils.MobileConfigurations;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -286,16 +284,21 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
}
}
private static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() {
public static Client getSSLClient() {
boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2.ignoreHostnameVerification"));
if(isIgnoreHostnameVerification) {
return new Client.Default(getSimpleTrustedSSLSocketFactory(), new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
});
}else {
return new Client.Default(getTrustedSSLSocketFactory(), null);
}
}
private static SSLSocketFactory getTrustedSSLSocketFactory() {
private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() {
try {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@ -318,4 +321,63 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
}
}
//FIXME - I know hard-cording values is a bad practice , this code is repeating in
// several class, so this hard-coding strings will be removed once this code block is moved into a central location
// this should be done after the 3.1.0 release.
private static SSLSocketFactory getTrustedSSLSocketFactory() {
try {
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location");
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Password");
String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Location");
KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,"JKS");
KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword);
return initSSLConnection(keyStore,keyStorePassword,trustStore);
} catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException
|CertificateException | IOException | UnrecoverableKeyException e) {
log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e);
return null;
}
}
private static SSLSocketFactory initSSLConnection(KeyStore keyStore,String keyStorePassword,KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException, KeyManagementException {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509");
trustManagerFactory.init(trustStore);
// Create and initialize SSLContext for HTTPS communication
SSLContext sslContext = SSLContext.getInstance("SSLv3");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
SSLContext.setDefault(sslContext);
return sslContext.getSocketFactory();
}
private static KeyStore loadKeyStore(String keyStorePath, String ksPassword, String type)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
InputStream fileInputStream = null;
try {
char[] keypassChar = ksPassword.toCharArray();
KeyStore keyStore = KeyStore.getInstance(type);
fileInputStream = new FileInputStream(keyStorePath);
keyStore.load(fileInputStream, keypassChar);
return keyStore;
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
}
private static KeyStore loadTrustStore(String trustStorePath, String tsPassword)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
return loadKeyStore(trustStorePath,tsPassword,"JKS");
}
}

@ -40,16 +40,14 @@ import org.wso2.carbon.appmgt.mdm.restconnector.authorization.client.dto.ApiRegi
import org.wso2.carbon.appmgt.mdm.restconnector.authorization.client.dto.TokenIssuerService;
import org.wso2.carbon.appmgt.mdm.restconnector.config.AuthorizationConfigurationManager;
import org.wso2.carbon.appmgt.mdm.restconnector.internal.AuthorizationDataHolder;
import org.wso2.carbon.base.ServerConfiguration;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;
/**
* This is a request interceptor to add oauth token header.
@ -131,16 +129,21 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
template.header(Constants.RestConstants.AUTHORIZATION, headerValue);
}
private static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() {
public static Client getSSLClient() {
boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2.ignoreHostnameVerification"));
if(isIgnoreHostnameVerification) {
return new Client.Default(getSimpleTrustedSSLSocketFactory(), new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
});
}else {
return new Client.Default(getTrustedSSLSocketFactory(), null);
}
}
private static SSLSocketFactory getTrustedSSLSocketFactory() {
private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() {
try {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@ -163,4 +166,62 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
}
}
//FIXME - I know hard-cording values is a bad practice , this code is repeating in
// several class, so this hard-coding strings will be removed once this code block is moved into a central location
// this should be done after the 3.1.0 release.
private static SSLSocketFactory getTrustedSSLSocketFactory() {
try {
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location");
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Password");
String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Location");
KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,"JKS");
KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword);
return initSSLConnection(keyStore,keyStorePassword,trustStore);
} catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException
|CertificateException | IOException | UnrecoverableKeyException e) {
log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e);
return null;
}
}
private static SSLSocketFactory initSSLConnection(KeyStore keyStore,String keyStorePassword,KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException, KeyManagementException {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509");
trustManagerFactory.init(trustStore);
// Create and initialize SSLContext for HTTPS communication
SSLContext sslContext = SSLContext.getInstance("SSLv3");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
SSLContext.setDefault(sslContext);
return sslContext.getSocketFactory();
}
private static KeyStore loadKeyStore(String keyStorePath, String ksPassword, String type)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
InputStream fileInputStream = null;
try {
char[] keypassChar = ksPassword.toCharArray();
KeyStore keyStore = KeyStore.getInstance(type);
fileInputStream = new FileInputStream(keyStorePath);
keyStore.load(fileInputStream, keypassChar);
return keyStore;
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
}
private static KeyStore loadTrustStore(String trustStorePath, String tsPassword)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
return loadKeyStore(trustStorePath,tsPassword,"JKS");
}
}

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@ -165,6 +165,7 @@
org.wso2.carbon.identity.oauth2.*,
org.wso2.carbon.utils,
org.wso2.carbon.utils.multitenancy,
org.wso2.carbon.base,
javax.net.ssl,
feign.slf4j
</Import-Package>

@ -29,6 +29,7 @@ import feign.jaxrs.JAXRSContract;
import feign.slf4j.Slf4jLogger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.device.mgt.input.adapter.http.authorization.client.OAuthRequestInterceptor;
import org.wso2.carbon.device.mgt.input.adapter.http.authorization.client.dto.AuthorizationRequest;
import org.wso2.carbon.device.mgt.input.adapter.http.authorization.client.dto.DeviceAccessAuthorizationAdminService;
@ -38,15 +39,12 @@ import org.wso2.carbon.device.mgt.input.adapter.http.util.AuthenticationInfo;
import org.wso2.carbon.device.mgt.input.adapter.http.util.PropertyUtils;
import org.wso2.carbon.event.input.adapter.core.exception.InputEventAdapterException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -112,16 +110,21 @@ public class DeviceAuthorizer {
return deviceMgtServerUrl;
}
private static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() {
public static Client getSSLClient() {
boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2.ignoreHostnameVerification"));
if(isIgnoreHostnameVerification) {
return new Client.Default(getSimpleTrustedSSLSocketFactory(), new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
});
}else {
return new Client.Default(getTrustedSSLSocketFactory(), null);
}
}
private static SSLSocketFactory getTrustedSSLSocketFactory() {
private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() {
try {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@ -144,4 +147,62 @@ public class DeviceAuthorizer {
}
}
//FIXME - I know hard-cording values is a bad practice , this code is repeating in
// several class, so this hard-coding strings will be removed once this code block is moved into a central location
// this should be done after the 3.1.0 release.
private static SSLSocketFactory getTrustedSSLSocketFactory() {
try {
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location");
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Password");
String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Location");
KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,"JKS");
KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword);
return initSSLConnection(keyStore,keyStorePassword,trustStore);
} catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException
|CertificateException | IOException | UnrecoverableKeyException e) {
log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e);
return null;
}
}
private static SSLSocketFactory initSSLConnection(KeyStore keyStore,String keyStorePassword,KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException, KeyManagementException {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509");
trustManagerFactory.init(trustStore);
// Create and initialize SSLContext for HTTPS communication
SSLContext sslContext = SSLContext.getInstance("SSLv3");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
SSLContext.setDefault(sslContext);
return sslContext.getSocketFactory();
}
private static KeyStore loadKeyStore(String keyStorePath, String ksPassword, String type)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
InputStream fileInputStream = null;
try {
char[] keypassChar = ksPassword.toCharArray();
KeyStore keyStore = KeyStore.getInstance(type);
fileInputStream = new FileInputStream(keyStorePath);
keyStore.load(fileInputStream, keypassChar);
return keyStore;
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
}
private static KeyStore loadTrustStore(String trustStorePath, String tsPassword)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
return loadKeyStore(trustStorePath,tsPassword,"JKS");
}
}

@ -29,6 +29,7 @@ import feign.jaxrs.JAXRSContract;
import feign.slf4j.Slf4jLogger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.device.mgt.input.adapter.http.authorization.client.dto.AccessTokenInfo;
import org.wso2.carbon.device.mgt.input.adapter.http.authorization.client.dto.ApiApplicationKey;
import org.wso2.carbon.device.mgt.input.adapter.http.authorization.client.dto.ApiApplicationRegistrationService;
@ -37,15 +38,12 @@ import org.wso2.carbon.device.mgt.input.adapter.http.authorization.client.dto.To
import org.wso2.carbon.device.mgt.input.adapter.http.util.PropertyUtils;
import org.wso2.carbon.event.input.adapter.core.exception.InputEventAdapterException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;
import java.util.Map;
/**
@ -183,16 +181,21 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
return refreshTimeOffset;
}
private static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() {
public static Client getSSLClient() {
boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2.ignoreHostnameVerification"));
if(isIgnoreHostnameVerification) {
return new Client.Default(getSimpleTrustedSSLSocketFactory(), new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
});
}else {
return new Client.Default(getTrustedSSLSocketFactory(), null);
}
}
private static SSLSocketFactory getTrustedSSLSocketFactory() {
private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() {
try {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@ -214,4 +217,63 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
return null;
}
}
//FIXME - I know hard-cording values is a bad practice , this code is repeating in
// several class, so this hard-coding strings will be removed once this code block is moved into a central location
// this should be done after the 3.1.0 release.
private static SSLSocketFactory getTrustedSSLSocketFactory() {
try {
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location");
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Password");
String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Location");
KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,"JKS");
KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword);
return initSSLConnection(keyStore,keyStorePassword,trustStore);
} catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException
|CertificateException | IOException | UnrecoverableKeyException e) {
log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e);
return null;
}
}
private static SSLSocketFactory initSSLConnection(KeyStore keyStore,String keyStorePassword,KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException, KeyManagementException {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509");
trustManagerFactory.init(trustStore);
// Create and initialize SSLContext for HTTPS communication
SSLContext sslContext = SSLContext.getInstance("SSLv3");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
SSLContext.setDefault(sslContext);
return sslContext.getSocketFactory();
}
private static KeyStore loadKeyStore(String keyStorePath, String ksPassword, String type)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
InputStream fileInputStream = null;
try {
char[] keypassChar = ksPassword.toCharArray();
KeyStore keyStore = KeyStore.getInstance(type);
fileInputStream = new FileInputStream(keyStorePath);
keyStore.load(fileInputStream, keypassChar);
return keyStore;
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
}
private static KeyStore loadTrustStore(String trustStorePath, String tsPassword)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
return loadKeyStore(trustStorePath,tsPassword,"JKS");
}
}

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -29,6 +29,7 @@ import feign.jaxrs.JAXRSContract;
import feign.slf4j.Slf4jLogger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.device.mgt.output.adapter.websocket.authentication.AuthenticationInfo;
import org.wso2.carbon.device.mgt.output.adapter.websocket.authorization.client.OAuthRequestInterceptor;
import org.wso2.carbon.device.mgt.output.adapter.websocket.authorization.client.dto.AuthorizationRequest;
@ -40,16 +41,13 @@ import org.wso2.carbon.device.mgt.output.adapter.websocket.util.PropertyUtils;
import org.wso2.carbon.device.mgt.output.adapter.websocket.util.WebSocketSessionRequest;
import org.wso2.carbon.event.output.adapter.core.exception.OutputEventAdapterException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.*;
import javax.websocket.Session;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -125,16 +123,21 @@ public class DeviceAuthorizer implements Authorizer {
return deviceMgtServerUrl;
}
private static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() {
public static Client getSSLClient() {
boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2.ignoreHostnameVerification"));
if(isIgnoreHostnameVerification) {
return new Client.Default(getSimpleTrustedSSLSocketFactory(), new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
});
}else {
return new Client.Default(getTrustedSSLSocketFactory(), null);
}
}
private static SSLSocketFactory getTrustedSSLSocketFactory() {
private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() {
try {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@ -156,4 +159,63 @@ public class DeviceAuthorizer implements Authorizer {
return null;
}
}
//FIXME - I know hard-cording values is a bad practice , this code is repeating in
// several class, so this hard-coding strings will be removed once this code block is moved into a central location
// this should be done after the 3.1.0 release.
private static SSLSocketFactory getTrustedSSLSocketFactory() {
try {
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location");
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Password");
String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Location");
KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,"JKS");
KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword);
return initSSLConnection(keyStore,keyStorePassword,trustStore);
} catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException
|CertificateException | IOException | UnrecoverableKeyException e) {
log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e);
return null;
}
}
private static SSLSocketFactory initSSLConnection(KeyStore keyStore,String keyStorePassword,KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException, KeyManagementException {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509");
trustManagerFactory.init(trustStore);
// Create and initialize SSLContext for HTTPS communication
SSLContext sslContext = SSLContext.getInstance("SSLv3");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
SSLContext.setDefault(sslContext);
return sslContext.getSocketFactory();
}
private static KeyStore loadKeyStore(String keyStorePath, String ksPassword, String type)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
InputStream fileInputStream = null;
try {
char[] keypassChar = ksPassword.toCharArray();
KeyStore keyStore = KeyStore.getInstance(type);
fileInputStream = new FileInputStream(keyStorePath);
keyStore.load(fileInputStream, keypassChar);
return keyStore;
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
}
private static KeyStore loadTrustStore(String trustStorePath, String tsPassword)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
return loadKeyStore(trustStorePath,tsPassword,"JKS");
}
}

@ -29,6 +29,7 @@ import feign.jaxrs.JAXRSContract;
import feign.slf4j.Slf4jLogger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.device.mgt.output.adapter.websocket.authorization.client.dto.AccessTokenInfo;
import org.wso2.carbon.device.mgt.output.adapter.websocket.authorization.client.dto.ApiApplicationKey;
import org.wso2.carbon.device.mgt.output.adapter.websocket.authorization.client.dto.ApiApplicationRegistrationService;
@ -37,15 +38,13 @@ import org.wso2.carbon.device.mgt.output.adapter.websocket.authorization.client.
import org.wso2.carbon.device.mgt.output.adapter.websocket.util.PropertyUtils;
import org.wso2.carbon.event.output.adapter.core.exception.OutputEventAdapterException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;
import java.util.Map;
/**
@ -185,16 +184,21 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
return refreshTimeOffset;
}
private static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() {
public static Client getSSLClient() {
boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2.ignoreHostnameVerification"));
if(isIgnoreHostnameVerification) {
return new Client.Default(getSimpleTrustedSSLSocketFactory(), new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
});
}else {
return new Client.Default(getTrustedSSLSocketFactory(), null);
}
}
private static SSLSocketFactory getTrustedSSLSocketFactory() {
private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() {
try {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@ -217,4 +221,62 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
}
}
//FIXME - (line 223 - 280 block) I know hard-cording values is a bad practice , this code is repeating in
// several class, so this hard-coding strings will be removed once this code block is moved into a central location
// this should be done after the 3.1.0 release.
private static SSLSocketFactory getTrustedSSLSocketFactory() {
try {
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location");
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Password");
String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Location");
KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,"JKS");
KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword);
return initSSLConnection(keyStore,keyStorePassword,trustStore);
} catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException
|CertificateException | IOException | UnrecoverableKeyException e) {
log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e);
return null;
}
}
private static SSLSocketFactory initSSLConnection(KeyStore keyStore, String keyStorePassword, KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException, KeyManagementException {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509");
trustManagerFactory.init(trustStore);
// Create and initialize SSLContext for HTTPS communication
SSLContext sslContext = SSLContext.getInstance("SSLv3");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
SSLContext.setDefault(sslContext);
return sslContext.getSocketFactory();
}
private static KeyStore loadKeyStore(String keyStorePath, String ksPassword, String type)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
InputStream fileInputStream = null;
try {
char[] keypassChar = ksPassword.toCharArray();
KeyStore keyStore = KeyStore.getInstance(type);
fileInputStream = new FileInputStream(keyStorePath);
keyStore.load(fileInputStream, keypassChar);
return keyStore;
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
}
private static KeyStore loadTrustStore(String trustStorePath, String tsPassword)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
return loadKeyStore(trustStorePath,tsPassword,"JKS");
}
}

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mb-extensions</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -42,6 +42,7 @@ import org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.config.Aut
import org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.internal.AuthorizationDataHolder;
import org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.util.AuthorizationCacheKey;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException;
@ -49,15 +50,12 @@ import org.wso2.carbon.user.api.UserStoreException;
import javax.cache.Cache;
import javax.cache.CacheConfiguration;
import javax.cache.Caching;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
@ -258,16 +256,21 @@ public class DeviceAccessBasedMQTTAuthorizer implements IAuthorizer {
}
}
private static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() {
public static Client getSSLClient() {
boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2.ignoreHostnameVerification"));
if(isIgnoreHostnameVerification) {
return new Client.Default(getSimpleTrustedSSLSocketFactory(), new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
});
}else {
return new Client.Default(getTrustedSSLSocketFactory(), null);
}
}
private static SSLSocketFactory getTrustedSSLSocketFactory() {
private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() {
try {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@ -290,4 +293,62 @@ public class DeviceAccessBasedMQTTAuthorizer implements IAuthorizer {
}
}
//FIXME - I know hard-cording values is a bad practice , this code is repeating in
// several class, so this hard-coding strings will be removed once this code block is moved into a central location
// this should be done after the 3.1.0 release.
private static SSLSocketFactory getTrustedSSLSocketFactory() {
try {
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location");
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Password");
String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Location");
KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,"JKS");
KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword);
return initSSLConnection(keyStore,keyStorePassword,trustStore);
} catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException
|CertificateException | IOException | UnrecoverableKeyException e) {
log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e);
return null;
}
}
private static SSLSocketFactory initSSLConnection(KeyStore keyStore,String keyStorePassword,KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException, KeyManagementException {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509");
trustManagerFactory.init(trustStore);
// Create and initialize SSLContext for HTTPS communication
SSLContext sslContext = SSLContext.getInstance("SSLv3");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
SSLContext.setDefault(sslContext);
return sslContext.getSocketFactory();
}
private static KeyStore loadKeyStore(String keyStorePath, String ksPassword, String type)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
InputStream fileInputStream = null;
try {
char[] keypassChar = ksPassword.toCharArray();
KeyStore keyStore = KeyStore.getInstance(type);
fileInputStream = new FileInputStream(keyStorePath);
keyStore.load(fileInputStream, keypassChar);
return keyStore;
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
}
private static KeyStore loadTrustStore(String trustStorePath, String tsPassword)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
return loadKeyStore(trustStorePath,tsPassword,"JKS");
}
}

@ -37,16 +37,14 @@ import org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.client.dto
import org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.client.dto.ApiRegistrationProfile;
import org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.client.dto.TokenIssuerService;
import org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.config.AuthorizationConfigurationManager;
import org.wso2.carbon.base.ServerConfiguration;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;
/**
* This is a request interceptor to add oauth token header.
@ -129,16 +127,21 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
tokenIssuerService = null;
}
private static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() {
public static Client getSSLClient() {
boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2.ignoreHostnameVerification"));
if(isIgnoreHostnameVerification) {
return new Client.Default(getSimpleTrustedSSLSocketFactory(), new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
});
}else {
return new Client.Default(getTrustedSSLSocketFactory(), null);
}
}
private static SSLSocketFactory getTrustedSSLSocketFactory() {
private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() {
try {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@ -161,4 +164,62 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
}
}
//FIXME - I know hard-cording values is a bad practice , this code is repeating in
// several class, so this hard-coding strings will be removed once this code block is moved into a central location
// this should be done after the 3.1.0 release.
private static SSLSocketFactory getTrustedSSLSocketFactory() {
try {
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location");
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Password");
String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty(
"Security.TrustStore.Location");
KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,"JKS");
KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword);
return initSSLConnection(keyStore,keyStorePassword,trustStore);
} catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException
|CertificateException | IOException | UnrecoverableKeyException e) {
log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e);
return null;
}
}
private static SSLSocketFactory initSSLConnection(KeyStore keyStore,String keyStorePassword,KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException, KeyManagementException {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, keyStorePassword.toCharArray());
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509");
trustManagerFactory.init(trustStore);
// Create and initialize SSLContext for HTTPS communication
SSLContext sslContext = SSLContext.getInstance("SSLv3");
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
SSLContext.setDefault(sslContext);
return sslContext.getSocketFactory();
}
private static KeyStore loadKeyStore(String keyStorePath, String ksPassword, String type)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
InputStream fileInputStream = null;
try {
char[] keypassChar = ksPassword.toCharArray();
KeyStore keyStore = KeyStore.getInstance(type);
fileInputStream = new FileInputStream(keyStorePath);
keyStore.load(fileInputStream, keypassChar);
return keyStore;
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
}
private static KeyStore loadTrustStore(String trustStorePath, String tsPassword)
throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
return loadKeyStore(trustStorePath,tsPassword,"JKS");
}
}

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>pull-notification-listeners</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>siddhi-extensions</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>siddhi-extensions</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,13 +23,13 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.mobile.android.ui</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<name>WSO2 Carbon - Mobile Android UI</name>
<packaging>pom</packaging>

@ -85,7 +85,8 @@
class="fw fw-success"></i></span>
<span id="cosu-profile-configuration-ok" class="has-success status-icon hidden"><i
class="fw fw-success"></i></span>
<span id="cosu-profile-configuration-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span>
<span id="cosu-profile-configuration-error" class="has-error status-icon hidden"><i
class="fw fw-error"></i></span>
</a>
<a href="javascript:void(0)" onclick="showAdvanceOperation('app-restriction', this)">
<span class="fw-stack fw-lg">
@ -109,7 +110,8 @@
class="fw fw-success"></i></span>
<span id="runtime-permission-policy-ok" class="has-success status-icon hidden"><i
class="fw fw-success"></i></span>
<span id="runtime-permission-policy-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span>
<span id="runtime-permission-policy-error" class="has-error status-icon hidden"><i
class="fw fw-error"></i></span>
</a>
<a href="javascript:void(0)" class="worker-profile"
onclick="showAdvanceOperation('cosu-system-update-policy', this)">
@ -157,7 +159,8 @@
</h2>
<div class="panel-title-description">
Enforce a configured passcode policy on Android devices.
Once this profile is applied, the device owners won't be able to modify the password settings on their devices.
Once this profile is applied, the device owners won't be able to modify the password settings on
their devices.
</div>
</div>
<div id="passcode-policy-body" class="panel-collapse panel-body collapse" role="tabpanel"
@ -307,7 +310,8 @@
</h2>
<div class="panel-title-description">
Restrict predefined settings on Android devices.
Once this profile is applied, the device owners won't be able to modify the configured settings on their devices.
Once this profile is applied, the device owners won't be able to modify the configured settings
on their devices.
</div>
</div>
<div id="camera-body" class="panel-collapse panel-body collapse" role="tabpanel"
@ -337,6 +341,7 @@
<b>work-profile owner</b> or <b>device owner</b>.</a>
</ul>
</div>
<br/>
<div class="wr-input-control worker-profile-or-owner">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-credentials-enabled" type="checkbox"
@ -518,8 +523,19 @@
<a id="policy-listing-status-msg"> Below Restrictions are valid only when the Agent is
the
<b>device owner</b>.</a>
{{#unless isdeviceownerenabled}}
<p><i>Please change the configuration <b>'isDeviceOwnerEnabled'</b> to
<b>'true'</b> if you have enabled device owner for the agent.</i></p>
{{/unless}}
</ul>
</div>
<br/>
<div
{{#unless isdeviceownerenabled}}
class="testing" title="Please change the configuration 'isDeviceOwnerEnabled' to
'true' if you have enabled device owner for the agent."
{{/unless}}
>
<div class="wr-input-control device-owner">
<label class="wr-input-control checkbox">
<input id="disallow-SMS-enabled" type="checkbox" class="operationDataKeys"
@ -560,7 +576,8 @@
<input id="disallow-configuring-bluetooth-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowConfigBluetooth"/>
<span class="helper" title="Having this checked would disallow configuring bluetooth.">
<span class="helper"
title="Having this checked would disallow configuring bluetooth.">
Disallow configuring bluetooth.
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
@ -585,7 +602,8 @@
<input id="disallow-configuring-tethering-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowConfigTethering"/>
<span class="helper" title="Having this checked would disallow configuring tethering.">
<span class="helper"
title="Having this checked would disallow configuring tethering.">
Disallow configuring tethering
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
@ -594,7 +612,8 @@
<br>
<div class="wr-input-control device-owner">
<label class="wr-input-control checkbox">
<input id="disallow-configuring-Wifi-enabled" type="checkbox" class="operationDataKeys"
<input id="disallow-configuring-Wifi-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowConfigWifi"/>
<span class="helper" title="Having this checked would disallow configuring Wifi.">
Disallow configuring Wifi
@ -616,7 +635,8 @@
<br>
<div class="wr-input-control device-owner">
<label class="wr-input-control checkbox">
<input id="disallow-outgoing-calls-enabled" type="checkbox" class="operationDataKeys"
<input id="disallow-outgoing-calls-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowOutgoingCalls"/>
<span class="helper" title="Having this checked would disallow outgoing calls.">
Disallow outgoing calls
@ -630,7 +650,8 @@
<input id="disallow-mount-physical-media-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowMountPhysicalMedia"/>
<span class="helper" title="Having this checked would disallow mount physical media.">
<span class="helper"
title="Having this checked would disallow mount physical media.">
Disallow mount physical media
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
@ -705,7 +726,8 @@
<br>
<div class="wr-input-control device-owner">
<label class="wr-input-control checkbox">
<input id="disallow-unmute-microphone-enabled" type="checkbox" class="operationDataKeys"
<input id="disallow-unmute-microphone-enabled" type="checkbox"
class="operationDataKeys"
data-key="disallowUnmuteMicrophone"/>
<span class="helper" title="Having this checked would disallow unmute microphone.">
Disallow unmute microphone
@ -713,8 +735,9 @@
</span>
</label>
</div>
</div>
<br>
<div class="device-owner">
<div class="">
<ul class="message message-info">
<i class="icon fw fw-info"></i>
<a id="policy-listing-status-msg">Below restrictions will be applied on devices with
@ -722,7 +745,8 @@
version 6.0 Marshmallow onwards only.</a>
</ul>
</div>
<div class="wr-input-control device-owner">
<br/>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input id="disable-status-bar-enabled" type="checkbox" class="operationDataKeys"
data-key="disableStatusBar"/>
@ -754,8 +778,10 @@
</label>
</h2>
<div class="panel-title-description">
Encrypt data on an Android device when the device is locked and make it readable when the device is unlocked.
Once this profile is applied, the device owners won't be able to modify the configured settings on their devices.
Encrypt data on an Android device when the device is locked and make it readable when the device
is unlocked.
Once this profile is applied, the device owners won't be able to modify the configured settings
on their devices.
</div>
</div>
<div id="encrypt-storage-body" class="panel-collapse panel-body collapse" role="tabpanel"
@ -798,7 +824,8 @@
</h2>
<div class="panel-title-description">
Configure the Wi-Fi settings on Android devices.
Once this profile is applied, the device owners won't be able to modify the configured settings on their devices.
Once this profile is applied, the device owners won't be able to modify the configured settings
on their devices.
</div>
</div>
<div id="wifi-body" class="panel-collapse panel-body collapse" role="tabpanel"
@ -1083,7 +1110,8 @@
<div id="cosu-profile-configuration-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="cosu-profile-configuration-body">
<hr/>
<div id="cosu-profile-configuration-feature-error-msg" class="alert alert-danger hidden" role="alert">
<div id="cosu-profile-configuration-feature-error-msg" class="alert alert-danger hidden"
role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<form class="form-horizontal">
@ -1092,7 +1120,7 @@
<label class="control-label">Restrict device operation time</label>
<label class="switch">
<input type="checkbox" id="gridGuideToggle" data-toggle="collapse"
data-target="#cosu-profile-restrict-operation-time" >
data-target="#cosu-profile-restrict-operation-time">
<span class="helper"></span>
</label>
</div>
@ -1248,7 +1276,8 @@
</h2>
<div class="panel-title-description">
Configure the VPN settings on Android devices.
Once this profile is applied, the device owners won't be able to modify the configured settings on their devices.
Once this profile is applied, the device owners won't be able to modify the configured settings
on their devices.
</div>
</div>
<div id="vpn-body" class="panel-collapse panel-body collapse" role="tabpanel"
@ -1320,7 +1349,8 @@
</label>
</h2>
<div class="panel-title-description">
Configure these settings to manage the applications in the work profile. </div>
Configure these settings to manage the applications in the work profile.
</div>
</div>
<div id="work-profile-policy-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="work-profile-policy-body">
@ -1353,11 +1383,13 @@
<div class="wr-input-control">
<label class="wr-input-label" for="work-profile-policy-enable-system-apps">
Enable System Apps
<span class="helper" title="The system applications that needs to enabled in the work-profile.">
<span class="helper"
title="The system applications that needs to enabled in the work-profile.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
(Provide the exact package name. Multiple package names can be provided as comma separated values. Ex: com.google.android.apps.maps,
(Provide the exact package name. Multiple package names can be provided as comma separated
values. Ex: com.google.android.apps.maps,
com.google.android.calculator)
</label>
<textarea id="workProfilePolicyEnableSystemApps" type="text"
@ -1367,11 +1399,13 @@
<div class="wr-input-control">
<label class="wr-input-label" for="work-profile-policy-hide-system-apps">
Hide System Apps
<span class="helper" title="The system applications that needs to be hidden in the work-profile.">
<span class="helper"
title="The system applications that needs to be hidden in the work-profile.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
(Provide the exact package name. Multiple package names can be provided as comma separated values. Ex: com.google.android.apps.maps,
(Provide the exact package name. Multiple package names can be provided as comma separated
values. Ex: com.google.android.apps.maps,
com.google.android.calculator)
</label>
<textarea id="work-profile-policy-hide-system-apps" class="form-control operationDataKeys"
@ -1380,10 +1414,12 @@
<div class="wr-input-control">
<label class="wr-input-label" for="work-profile-policy-unhide-system-apps">
Unhide System Apps
<span class="helper" title=" The system applications that needs to be shown in the work-profile."></span>
<span class="helper"
title=" The system applications that needs to be shown in the work-profile."></span>
</span>
<br>
(Provide the exact package name. Multiple package names can be provided as comma separated values. Ex: com.google.android.apps.maps,
(Provide the exact package name. Multiple package names can be provided as comma separated
values. Ex: com.google.android.apps.maps,
com.google.android.calculator)
</label>
<textarea id="work-profile-policy-unhide-system-apps" class="form-control operationDataKeys"
@ -1397,7 +1433,8 @@
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
(Provide the exact package name. Multiple package names can be provided as comma separated values. Ex: com.google.android.apps.maps,
(Provide the exact package name. Multiple package names can be provided as comma separated
values. Ex: com.google.android.apps.maps,
com.google.android.calculator)
</label>
<textarea id="work-profile-policy-install-playstore-apps" class="form-control operationDataKeys"
@ -1492,7 +1529,8 @@
<span class="index"></span>
</td>
<td data-title="App Name">
<input type="text" class="form-control grid-input-text" data-child-key="appName"
<input type="text" class="form-control grid-input-text"
data-child-key="appName"
maxlength="50" data-default="" placeholder="[ Android Pay ]"/>
</td>
<td data-title="Package Name">
@ -1516,7 +1554,8 @@
</td>
<td>
<span class="list-group-item-actions">
<a href="#runtime-permission-applications-grid" class="grid-input-remove"
<a href="#runtime-permission-applications-grid"
class="grid-input-remove"
data-click-event="remove-form">
<span class="fw-stack helper" title="Remove Entry">
<i class="fw fw-circle-outline fw-stack-2x"></i>
@ -1538,7 +1577,8 @@
Already granted or denied permissions are not affected by this policy.
<br>
<i class="icon fw fw-info"></i>
Permissions can be granted or revoked only for applications built with a Target SDK Version of Android Marshmallow or later.
Permissions can be granted or revoked only for applications built with a Target SDK Version
of Android Marshmallow or later.
</ul>
</div>
</div>

@ -22,7 +22,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mobile-plugins</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>windows-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,13 +23,13 @@
<parent>
<artifactId>windows-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.mobile.windows.ui</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<name>WSO2 Carbon - Mobile Windows UI</name>
<packaging>pom</packaging>

@ -51,7 +51,7 @@ var utils = function () {
};
// calling dynamic client app registration service endpoint
var requestURL = deviceMgtProps["oauthProvider"]["appRegistration"]
["dynamicClientAppRegistrationServiceURL"];
["apiManagerClientAppRegistrationServiceURL"];
var requestPayload = dcAppProperties;
var encodedBasicOauth = publicMethods.encode(username + ":" + password);

@ -22,7 +22,7 @@
<parent>
<artifactId>windows-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mobile-plugins</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.analytics.feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Analytics Feature</name>
<url>http://wso2.org</url>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.iot.device.statistics.dashboard.feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Analytics Feature</name>
<url>http://wso2.org</url>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>androidsense-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Android Sense Analytics Feature</name>
<url>http://wso2.org</url>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>androidsense-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.backend.feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Android Sense Backend Feature</name>
<url>http://wso2.org</url>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>androidsense-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.ui.feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Android Sense UI Feature</name>
<url>http://wso2.org</url>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>arduino-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>arduino-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>arduino-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,13 +22,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>device-types-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management IoT Plugins Feature</name>
<url>http://wso2.org</url>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>raspberrypi-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>raspberrypi-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>raspberrypi-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>virtual-fire-alarm-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>virtual-fire-alarm-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>virtual-fire-alarm-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -20,13 +20,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.wso2.carbon.appmgt.mdm.osgiconnector.feature</artifactId>
<packaging>pom</packaging>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<name>WSO2 Carbon - App management MDM OSGI Connector</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for APP management OSGI MDM connection
@ -36,7 +36,7 @@
<dependency>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>org.wso2.carbon.appmgt.mdm.osgiconnector</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>

@ -20,13 +20,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.wso2.carbon.appmgt.mdm.restconnector.feature</artifactId>
<packaging>pom</packaging>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<name>WSO2 Carbon - App management MDM REST Connector</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for APP management MDM REST connection
@ -36,7 +36,7 @@
<dependency>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>org.wso2.carbon.appmgt.mdm.restconnector</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>

@ -23,14 +23,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.adapter.feature</artifactId>
<packaging>pom</packaging>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Adapters Feature</name>
<url>http://wso2.org</url>
<description>This feature contains the adapter bundles required for IoT Server</description>

@ -3,14 +3,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.notification.listener.feature</artifactId>
<packaging>pom</packaging>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<name>WSO2 Carbon - Notification Listener</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required iot core listeners</description>

@ -20,13 +20,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.wso2.extension.siddhi.execution.json.feature</artifactId>
<packaging>pom</packaging>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<name>WSO2 Siddhi Execution Extension - Json Feature</name>
<url>http://wso2.org</url>
<description>This feature contains Siddhi extension feature for changing a json string to individual properties.</description>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,13 +22,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>extensions-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management Extensions</name>
<url>http://wso2.org</url>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>android-plugin-feature</artifactId>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.mobile.android.feature</artifactId>
<packaging>pom</packaging>
<version>4.0.26-SNAPSHOT</version>
<version>4.0.29-SNAPSHOT</version>
<name>WSO2 Carbon - Android Device Management Feature</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for Android Device Management

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save