ConnectUserName OpcUa Client V1.2.2

205 views
Skip to first unread message

Florent Pause

unread,
Aug 27, 2021, 6:28:10 AM8/27/21
to open62541
Hello,

I created an OpcUaClient where I connect to a local opcua server and I am monitoring items. I can connect properly to the server as anonymous. But now I'd like to connect to the server with UserName and Password. But the function UA_Client_connectUsername returns an "BadInternalError". I don't know what I did wrong. 
I can connect to the local OpcUa server with UaExpert so I am sure that the username and password are correct. Attached you'll find my program and the console output.
Can you help me for doing this?

Thank you,

Best Regards,  
Console.png
Code.png

Luca Olivetti

unread,
Aug 27, 2021, 6:44:47 AM8/27/21
to open...@googlegroups.com
El 27/8/21 a les 12:28, Florent Pause ha escrit:

> Can you help me for doing this?

From my notes:

1) open62541 must be compiled with encryption support (at the time by
default it wasn't, now I don't know).

2) you have to use a client certificate (a self signed one will do)

Then you call UA_ClientConfig_setDefaultEncryption to use the client
certificate.

Hope it works for you

Bye.

--
Luca

Florent Pausé

unread,
Sep 3, 2021, 11:49:15 AM9/3/21
to open62541
I tried for one week to compile the source code with encryption support and I got issues.
I am on Windows 10, using CMake and visual Studio to compile the source code.
Were you (or anybody) able to compile the source code with Encryption support (openSSL) correctly?

Best regards,

Florent Pausé 

Luca Olivetti

unread,
Sep 3, 2021, 12:56:01 PM9/3/21
to open...@googlegroups.com
El 3/9/21 a les 17:49, Florent Pausé ha escrit:
> I tried for one week to compile the source code with encryption support
> and I got issues.
> I am on Windows 10, using CMake and visual Studio to compile the source
> code.
> Were you (or anybody) able to compile the source code with Encryption
> support (openSSL) correctly?

At the time I only tested under Linux, sorry.

Bye

--
Luca

Toddie Hamburg

unread,
Dec 23, 2021, 3:34:10 AM12/23/21
to open62541
I have also tried to make connection with Open62541.UA_Client_ConnectUsername(Client, EndpointURL, UserName, Password), but without
success. I use the actual Open62541.pas from https://github.com/fluisgirardi/fpopen62541
Now i need compiled DLL's for 32Bit/64Bit V1.2.2 or V1.3 for Windows including the possibility to use UA_Client_ConnectUserName.
If anyone has compiled DLL's, please feel fre to send them to me.


Thank you !

Reply all
Reply to author
Forward
0 new messages