0

I have an OPC UA server based on open62541 that connects correctly with the client UAExpert of UnifiedAutomotion. I try to add a server certificate but the UAExpert cannot find it, even if I add it to the trust list from UAExpert>Certificate manager. Is loaded correctly?

UA_Server *server = UA_Server_new();
UA_ServerConfig *config = UA_Server_getConfig(server);
config->serverCertificate = loadCertificate(); // Returns UA_ByteString of the file certificate.der
if(config->serverCertificate.length > 0)
   UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "Certificate loaded");

UA_ServerConfig_setDefault(config);

I don't know if the method UA_ServerConfig_setDefault is enough for loading certificate, because the examples I have seen uses UA_ServerConfig_setDefaultWithSecurityPolicies for setting the server configuration. I tried to test the example of server_encrypted.c but when I compile it throws exceptions of libraries and glibc versions.

Thanks in advance.

Kevin Herron
  • 6,500
  • 3
  • 26
  • 35
anvitu
  • 1
  • 1

1 Answers1

0

Welcome to stackoverflow.

I have no experience with open6254, but the client connects using an endpoint from the list of endpoints previously read from the server. The chosen endpoint should contain a certificate and when calling createession the server resends the certificate, if both certificates are not equal, the client must cancel the process, as required by the OPC UA specifications.

Maybe one of the two certificates is not being sent by the server or they are not equals.

I think you better ask here https://groups.google.com/forum/#!forum/open62541

from56
  • 3,976
  • 2
  • 13
  • 23