|
|
|
@ -160,7 +160,15 @@ public class LwM2MBootstrapSecurityStore implements BootstrapSecurityStore { |
|
|
|
BootstrapConfiguration bootstrapObject = getBootstrapParametersFromThingsboard(store.getDeviceProfile()); |
|
|
|
lwM2MBootstrapConfig.servers = JacksonUtil.fromString(JacksonUtil.toString(bootstrapObject.getServers()), LwM2MBootstrapServers.class); |
|
|
|
LwM2MServerBootstrap profileServerBootstrap = JacksonUtil.fromString(JacksonUtil.toString(bootstrapObject.getBootstrapServer()), LwM2MServerBootstrap.class); |
|
|
|
if (SecurityMode.NO_SEC != profileServerBootstrap.getSecurityMode() && profileServerBootstrap != null) { |
|
|
|
profileServerBootstrap.setSecurityHost( profileServerBootstrap.getHost()); |
|
|
|
profileServerBootstrap.setSecurityPort( profileServerBootstrap.getPort()); |
|
|
|
} |
|
|
|
LwM2MServerBootstrap profileLwm2mServer = JacksonUtil.fromString(JacksonUtil.toString(bootstrapObject.getLwm2mServer()), LwM2MServerBootstrap.class); |
|
|
|
if (SecurityMode.NO_SEC != profileLwm2mServer.getSecurityMode() && profileLwm2mServer != null) { |
|
|
|
profileLwm2mServer.setSecurityHost(profileLwm2mServer.getHost()); |
|
|
|
profileLwm2mServer.setSecurityPort(profileLwm2mServer.getPort()); |
|
|
|
} |
|
|
|
UUID sessionUUiD = UUID.randomUUID(); |
|
|
|
TransportProtos.SessionInfoProto sessionInfo = helper.getValidateSessionInfo(store.getMsg(), sessionUUiD.getMostSignificantBits(), sessionUUiD.getLeastSignificantBits()); |
|
|
|
bsSessions.put(store.getEndpoint(), sessionInfo); |
|
|
|
|