2019/8/5 11:25:37.736 EXCEPTION BadCertificateInvalid 'The receiver's certificate thumbprint is not valid.' The receiver's certificate thumbprint is not valid.
2019/8/5 11:25:37.736 TCPSERVERCHANNEL ForceChannelFault Socket=01186BC3, ChannelId=0, TokenId=0, Reason=Id: BadCertificateInvalid
Description: Could not verify security on OpenSecureChannel request.
Id: BadCertificateInvalid
Description: The receiver's certificate thumbprint is not valid.
client.c code:
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
include
include
include "open62541.h"
define DISCOVERY_SERVER_ENDPOINT "opc.tcp://10.10.6.35:58810/GlobalDiscoveryServer"
UA_Boolean running = true;
static void stopHandler(int sign) { UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "received ctrl-c"); running = false; }
/ loadFile parses the certificate file.
@return Returns the file content after parsing / static UA_INLINE UA_ByteString loadFile(const char const path) { UA_ByteString fileContents = UA_STRING_NULL;
/ Open the file / FILE fp = fopen(path, "rb"); if(!fp) { errno = 0; / We read errno also from the tcp layer... */ return fileContents; }
/ Get the file length, allocate the data and read / fseek(fp, 0, SEEK_END); fileContents.length = (size_t)ftell(fp); fileContents.data = (UA_Byte )UA_malloc(fileContents.length sizeof(UA_Byte)); if(fileContents.data) { fseek(fp, 0, SEEK_SET); size_t read = fread(fileContents.data, sizeof(UA_Byte), fileContents.length, fp); if(read != fileContents.length) UA_ByteString_clear(&fileContents); } else { fileContents.length = 0; } fclose(fp);
return fileContents; }
int main(int argc, char *argv) { signal(SIGINT, stopHandler); / catches ctrl-c */ signal(SIGTERM, stopHandler);
if 1
endif
}
ua.der ua.pem : http://123.207.229.118/myapp1.rar
GlobalDiscoveryServer.log.txt :
2019/8/5 11:25:37.736 EXCEPTION BadCertificateInvalid 'The receiver's certificate thumbprint is not valid.' The receiver's certificate thumbprint is not valid. 2019/8/5 11:25:37.736 TCPSERVERCHANNEL ForceChannelFault Socket=01186BC3, ChannelId=0, TokenId=0, Reason=Id: BadCertificateInvalid Description: Could not verify security on OpenSecureChannel request.
Id: BadCertificateInvalid Description: The receiver's certificate thumbprint is not valid.