diff --git a/src/client/client.cpp b/src/client/client.cpp index 0c82ddc1..e2bc96ec 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -281,7 +281,12 @@ void UaClient::Connect(const EndpointDescription & endpoint) { sessionParameters.UserIdentityToken.setPolicyId(token.PolicyId); sessionParameters.UserIdentityToken.setUser(user, password); - EncryptPassword(sessionParameters.UserIdentityToken, createSessionResponse); + + if(token.SecurityPolicyUri != "http://opcfoundation.org/UA/SecurityPolicy#None") + { + EncryptPassword(sessionParameters.UserIdentityToken, createSessionResponse); + } + user_identify_token_found = true; break; }