fix_bug_lwm2m: add authorizer to lh server
This commit is contained in:
parent
ea4886726a
commit
aec9fc68f4
@ -88,7 +88,7 @@ public class LwM2mCredentialsSecurityInfoValidator {
|
||||
}
|
||||
|
||||
TbLwM2MSecurityInfo securityInfo = resultSecurityStore[0];
|
||||
if (securityInfo.getSecurityMode() == null) {
|
||||
if (securityInfo != null && securityInfo.getSecurityMode() == null) {
|
||||
throw new LwM2MAuthException();
|
||||
}
|
||||
return securityInfo;
|
||||
|
||||
@ -125,6 +125,7 @@ public class DefaultLwM2mTransportService implements LwM2MTransportService {
|
||||
/* Set securityStore with new registrationStore */
|
||||
builder.setSecurityStore(securityStore);
|
||||
builder.setRegistrationStore(registrationStore);
|
||||
builder.setAuthorizer(authorizer);
|
||||
|
||||
|
||||
// Create Californium Endpoints Provider:
|
||||
|
||||
@ -141,7 +141,7 @@ public class LwM2mClientContextImpl implements LwM2mClientContext {
|
||||
}
|
||||
oldSession = client.getSession();
|
||||
TbLwM2MSecurityInfo securityInfo = securityStore.getTbLwM2MSecurityInfoByEndpoint(client.getEndpoint());
|
||||
if (securityInfo.getSecurityMode() != null) {
|
||||
if (securityInfo != null && securityInfo.getSecurityMode() != null) {
|
||||
if (SecurityMode.X509.equals(securityInfo.getSecurityMode())) {
|
||||
securityStore.registerX509(registration.getEndpoint(), registration.getId());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user