Hello,
using the lib for Delphi2010 I'm trying to connect to a Siemens S7 OPC UA server. Since the server only accept sign and encrypted connections with Basic256 I can't establish a connection. If the server allows connections without sign and encrypt, it works.
With UaExpert I can connect using this config: Security Policy = Basic256; Message Security Mode = Sign & Encrypt.
When I try to connect with the folling code:
MyUAClient := TEasyUAClient.Create(nil);
EasyUAClientConfiguration := TEasyUAClientConfiguration.Create(nil);
aUserIdentity := TUserIdentity.Create (nil);
aUserIdentity.UserNameTokenInfo.UserName := OPCUserName;
aUserIdentity.UserNameTokenInfo.Password := OPCPassword;
UAEndPointSelectionPolicy := TUAEndPointSelectionPolicy.Create(nil);
UAEndPointSelectionPolicy.AllowedMessageSecurityModes := UAMessageSecurityModes_SecuritySignAndEncrypt;
// UAEndPointSelectionPolicy.MessageSecurityPreference := _sign.positive; don't work
// after searching for the constant _sign.positive I've tried to use 1 or 0 or -1 instead:
UAEndPointSelectionPolicy.MessageSecurityPreference := 1;
EasyUAClientConfiguration.AdaptableParameters.SessionParameters.UserIdentity := aUserIdentity.DefaultInterface;
I get this message:
Cannot select the best (or any) endpoint for OPC-UA client session. No suitable endpoint has been found. The server returned 1 endpoint(s).
There are several configurable settings that influence which endpoints are eligible for selection, such as the endpoint selection policy, and also parameters that influence how thorough checks of the information returned by the server are made. You may need to change the endpoint selection policy, or the additional parameters, in order to be able to connect. If you are unsure about what is causing all endpoints to be rejected, analyze the log entries generated by the component.
Candidate selection report follows.
[0:ValidNotEligible(SecurityMode(None, NotAllowed))]
Fehler: Cannot select the best (or any) endpoint for OPC-UA client session. No suitable endpoint has been found. The server returned 1 endpoint(s).
There are several configurable settings that influence which endpoints are eligible for selection, such as the endpoint selection policy, and also parameters that influence how thorough checks of the information returned by the server are made. You may need to change the endpoint selection policy, or the additional parameters, in order to be able to connect. If you are unsure about what is causing all endpoints to be rejected, analyze the log entries generated by the component.
Candidate selection report follows.
[0:ValidNotEligible(SecurityMode(None, NotAllowed))]
Do you have an idea what the problem can be?
Thanks.
Kind regards
David