Skip to content

Commit

Permalink
1.4 (#76)
Browse files Browse the repository at this point in the history
* fix(pubsub): include GroupVersion data type in pubsub informaiton model (open62541#6789)

The data type of the mandatory entry GroupVersion in the PubSub info
model was uninitialized because of a missing read callback.

* fix(pubsub): Only check message timeout if message is valid (open62541#6786)

This issue has already been resolved on the master branch with commit
c4686f6.

* refactor(core): Encode string as empty (instead of NULL) when the data-pointer is > NULL

Before we required the data pointer to be exactly the UA_EMPTY_ARRAY_SENTINEL.
But there can be situations where the data pointers goes to "" (empty
string with the \0 ending). Then the string should be empty -- and not
null (length -1).

* fix(plugins): Reenable writing rejected certificates to a reject folder

* refactor(server): Search for the last '#' in securityPolicyUriPostfix

There might be strange cases where the URI has several #.
And searching from the back is faster.

* refactor(server): Expose securityPolicyUriPostfix in the internal API

* refactor(server): Check the postfix of the UserTokenPolicy PolicyId also

* fix(server): Consider allowNonePolicyPassword in GetEndpoints

Remove all UserTokenPolicies that would allow an unencrypted password
transmitted.

* fix(build): Enable building static library on Win32

* fix(pubsub): fix setting writer group messsage & transport settings (open62541#6814)

* fix(build): unit test compilation under MSVC

* refactor(server): Don't extend the DiscoveryUrls in the configuration with EndpointUrls from requests

* refactor(build): Bump version to v1.4.7

* fix(pubsub): Fix MQTT subscribe ReaderGroup config copying (open62541#6808) (open62541#6850)

* refactor(tools): Add visual studio temp files to .gitignore (open62541#6872)

also added Visual Studio CMakeSettings.json

* refactor(core): Make SecureChannel message processing less indirect

* fix(core): Stop processing after a synchronous response

Before it was possible that two responses were received at the same
time. If the client is waiting for the first response, then the second
was processed also before returning the control flow to the client.

This lead to situations where a PublishResponse was processed before
notifying the client about a MonitoredItem handle established just
before.

This fixes open62541#5226.

* fix(server): Immediately set new SecureChannels to CONNECTED

Now they are correctly purged when too many connections are open.
This fixes the problem reported in open62541#6863.

* feat(plugins): Support certificate generation with mbedTLS. (open62541#6145)

(cherry picked from commit 1f19a8e)

* fix(plugin): cert_gen mbedTLS fix header file include and add to build

Co-authored-by: Christian von Arnim <[email protected]>
Signed-off-by: Goetz Goerisch <[email protected]>

* fix(build): align inclusion of architecture.h

Co-authored-by: Noel Graf <[email protected]>
Signed-off-by: Goetz Goerisch <[email protected]>

* fix(build): Remove CMake warnings concerning PRE_BUILD custom command options

* refactor(build): Use the native Python3 support for CMake

* fix(build): Fix caching of UA_FILE_NS0 variable

The caching lead reconfigurations in the CMake GUI to be ignored.

* refactor(plugins): Refactor out mbedtlsSameBuf to compare mbedTLS buffers

* refactor(plugins): Small cleanups in ua_pki_mbedtls.c

* fix(plugins): Also consider the trustlist to find issuers in ua_pki_mbedtls.c

* fix(plugins): Return detailed status codes for revocation checks in ua_pki_mbedtls.c

* fix(plugins): Also consider the trustlist to find issuers in ua_pki_openssl.c

* fix(plugins): Return detailed status codes for revocation checks in ua_pki_openssl.c

* feat(plugins): Disable revocation lists checks in ua_pki_mbedtls.c if zero crl are loaded

Avoid breakage for users of the 1.3 release family but still log a warning.

* feat(plugins): Disable revocation lists checks in ua_pki_openssl.c if zero crl are loaded

Avoid breakage for users of the 1.3 release family but still log a warning.

* refactor(build): Bump version to v1.3.15

* Fix amalgamation order

ua_securitypolicy_none.c requires UA_*_LoadCertificate() if encryption is enabled.

* refactor(build): Bump version to v1.4.8

* fix(core): Mask additional certificate verification statuscodes in the ERR response

* refactor(plugins): Remove comparison of authorityKeyIdentifier / subjectKeyIdentifier not supported by CTT

The CTT example Security User X509/001.js expects that an issuer is
selected where the authorityKeyIdentifier / subjectKeyIdentifier do not
match. No longer use X509_check_issued, but rather manually check if the
issuer name and subject name match -- with no other checks beyond that.

* fix(core): avoid double decrement in UA_KeyValueMap_remove()

* test(core): add test for removing keys from UA_KeyValueMap

* test(core): add tests for most UA_KeyValueMap operations

* fix(plugin): fix clearing previous plugin in UA_AccessControl_default()

* fix(plugins): Fix generation of wrong private key format for MbedTLS

- Re-order case statements to match order in other code
- Use derived compile-time constant to avoid duplication

* refactor(client): Simplify getEndpointUrl

* fix(client): The server can send no ServerCertificate in the asym header for #None

Even if a ServerCertificate is defined for the Endpoint. Some servers in
the wild show this behavior. This was reported by @mario-reif in open62541#6926.

* fix[pubsub]: Properly remove key rollover callback

* fix(plugin): add SecurityPolicy#Aes256_Sha256_RsaPss to json configuration plugin

Add the Aes256_Sha256_RsaPss security policy to
the json configuration plugin. The server_config.json5
example configuration file is updated as well.

* fix(pubsub): Don’t add the key rollover callback twice (open62541#6933)

* fix(tools): Fix compilation for Microsoft C compiler

* fix(pubsub): missing parameter in UA_LOCK_ASSERT() macro

* fis(pubsub): fix some copy past error after apparently changing an API to work on the server rather than the PubSubManager reference

* improve(eventloop): make conditional macros more clear for the Ehernet ConnectionManager which is only implemented on Linux

* fix(pubsub): Always update the timed callback in UA_PubSubKeyStorage_addKeyRolloverCallback

* refactor(examples,tests): avoid spaces for mDNS records

Avoid spaces in mdnsServerName as this is used for mDNS records.

This is a backport of 711b032
into the 1.4 branch.

Signed-off-by: Florian La Roche <[email protected]>

* feat(ci): build and upload amalgamation sources for releases

* feat(ci): always run release workflow

---------

Signed-off-by: Goetz Goerisch <[email protected]>
Signed-off-by: Florian La Roche <[email protected]>
Co-authored-by: Andreas Eckerstorfer <[email protected]>
Co-authored-by: estr Eckerstorfer Andreas <[email protected]>
Co-authored-by: Julius Pfrommer <[email protected]>
Co-authored-by: Eugene Melekhov <[email protected]>
Co-authored-by: Leonardo <[email protected]>
Co-authored-by: Julius Pfrommer <[email protected]>
Co-authored-by: Leonardo <[email protected]>
Co-authored-by: Noel Graf <[email protected]>
Co-authored-by: Goetz Goerisch <[email protected]>
Co-authored-by: Christian von Arnim <[email protected]>
Co-authored-by: Jannis Völker <[email protected]>
Co-authored-by: Sebastian Goll <[email protected]>
Co-authored-by: Sebastian Goll <[email protected]>
Co-authored-by: Maciej Stolarczyk <[email protected]>
Co-authored-by: Costin Zanfir <[email protected]>
Co-authored-by: Maciej Stolarczyk <[email protected]>
Co-authored-by: Rolf Kalbermatter <[email protected]>
Co-authored-by: Florian La Roche <[email protected]>
Co-authored-by: Marwin Glaser <[email protected]>
  • Loading branch information
20 people authored Jan 9, 2025
1 parent 2396d79 commit d389e61
Show file tree
Hide file tree
Showing 52 changed files with 1,783 additions and 1,626 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build Release Artifacts

on:
push:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: sudo apt-get install -y -qq libmbedtls-dev
- run: source tools/ci.sh && build_release_amalgamation
- run: gh release upload ${{ github.ref_name }} build/open62541.{c,h}
env:
GH_TOKEN: ${{ github.token }}
if: github.event_name == 'release'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ Makefile
Pipfile
Pipfile.lock
.vscode
/.vs
**/libxml2
debian/*
/CMakeSettings.json

# clangd cache
.cache/
Expand Down
49 changes: 26 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# overwritten with more detailed information if git is available.
set(OPEN62541_VER_MAJOR 1)
set(OPEN62541_VER_MINOR 4)
set(OPEN62541_VER_PATCH 6)
set(OPEN62541_VER_PATCH 8)
set(OPEN62541_VER_LABEL "-undefined") # like "-rc1" or "-g4538abcd" or "-g4538abcd-dirty"
set(OPEN62541_VER_COMMIT "unknown-commit")

Expand Down Expand Up @@ -161,10 +161,8 @@ if(UA_ENABLE_ENCRYPTION STREQUAL "OFF" OR ${_tmp} GREATER -1)
set(UA_ENABLE_ENCRYPTION_MBEDTLS ON)
elseif(UA_ENABLE_ENCRYPTION STREQUAL "OPENSSL")
set(UA_ENABLE_ENCRYPTION_OPENSSL ON)
set(UA_ENABLE_CERT_REJECTED_DIR OFF)
elseif(UA_ENABLE_ENCRYPTION STREQUAL "LIBRESSL")
set(UA_ENABLE_ENCRYPTION_LIBRESSL ON)
set(UA_ENABLE_CERT_REJECTED_DIR OFF)
endif()
# Only for backward compatability
elseif(UA_ENABLE_ENCRYPTION)
Expand All @@ -181,7 +179,6 @@ else()
if(UA_ENABLE_ENCRYPTION_OPENSSL)
set(UA_ENABLE_ENCRYPTION "OPENSSL")
set(UA_ENABLE_ENCRYPTION_MBEDTLS OFF)
set(UA_ENABLE_CERT_REJECTED_DIR OFF)
endif()
endif()

Expand Down Expand Up @@ -548,7 +545,7 @@ endif()

if(MINGW)
# GCC stack protector support
list(APPEND open62541_LIBRARIES ssp)
list(APPEND open62541_LIBRARIES ws2_32 ssp)
endif()

#####################
Expand Down Expand Up @@ -880,6 +877,7 @@ endif()

if (NOT "${UA_ARCHITECTURE}" STREQUAL "none")
list(PREPEND lib_headers ${PROJECT_SOURCE_DIR}/arch/posix/ua_architecture.h)
list(PREPEND lib_headers ${PROJECT_SOURCE_DIR}/arch/win32/ua_architecture.h)
endif()

if(UA_ENABLE_PARSING)
Expand Down Expand Up @@ -967,7 +965,6 @@ set(architecture_sources)

if(NOT "${UA_ARCHITECTURE}" STREQUAL "none")
list(APPEND architecture_headers
${PROJECT_SOURCE_DIR}/arch/win32/ua_architecture.h
${PROJECT_SOURCE_DIR}/arch/common/ua_timer.h
${PROJECT_SOURCE_DIR}/arch/eventloop_common.h
${PROJECT_SOURCE_DIR}/arch/eventloop_posix.h)
Expand Down Expand Up @@ -1007,9 +1004,7 @@ set(plugin_sources ${PROJECT_SOURCE_DIR}/plugins/ua_log_stdout.c
${PROJECT_SOURCE_DIR}/plugins/ua_accesscontrol_default.c
${PROJECT_SOURCE_DIR}/plugins/ua_nodestore_ziptree.c
${PROJECT_SOURCE_DIR}/plugins/ua_nodestore_hashmap.c
${PROJECT_SOURCE_DIR}/plugins/ua_config_default.c
${PROJECT_SOURCE_DIR}/plugins/crypto/ua_pki_none.c
${PROJECT_SOURCE_DIR}/plugins/crypto/ua_securitypolicy_none.c)
${PROJECT_SOURCE_DIR}/plugins/ua_config_default.c)

# For file based server configuration
if(UA_ENABLE_JSON_ENCODING)
Expand Down Expand Up @@ -1046,7 +1041,7 @@ if(UA_ENABLE_ENCRYPTION_MBEDTLS OR UA_ENABLE_PUBSUB_ENCRYPTION OR UA_ENABLE_AMAL
endif()

if(UA_ENABLE_PUBSUB_ENCRYPTION)
list(INSERT plugin_sources 1
list(APPEND plugin_sources
${PROJECT_SOURCE_DIR}/plugins/crypto/mbedtls/securitypolicy_pubsub_aes128ctr.c
${PROJECT_SOURCE_DIR}/plugins/crypto/mbedtls/securitypolicy_pubsub_aes256ctr.c)
endif()
Expand All @@ -1056,12 +1051,13 @@ if(UA_ENABLE_ENCRYPTION_MBEDTLS OR UA_ENABLE_ENCRYPTION_OPENSSL OR UA_ENABLE_ENC
endif()

if(UA_ENABLE_ENCRYPTION_MBEDTLS OR UA_ENABLE_AMALGAMATION)
list(INSERT plugin_sources 1
list(APPEND plugin_sources
${PROJECT_SOURCE_DIR}/plugins/crypto/mbedtls/ua_securitypolicy_basic128rsa15.c
${PROJECT_SOURCE_DIR}/plugins/crypto/mbedtls/ua_securitypolicy_basic256.c
${PROJECT_SOURCE_DIR}/plugins/crypto/mbedtls/ua_securitypolicy_basic256sha256.c
${PROJECT_SOURCE_DIR}/plugins/crypto/mbedtls/ua_securitypolicy_aes128sha256rsaoaep.c
${PROJECT_SOURCE_DIR}/plugins/crypto/mbedtls/ua_securitypolicy_aes256sha256rsapss.c
${PROJECT_SOURCE_DIR}/plugins/crypto/mbedtls/ua_mbedtls_create_certificate.c
${PROJECT_SOURCE_DIR}/plugins/crypto/mbedtls/ua_pki_mbedtls.c)
endif()

Expand All @@ -1072,7 +1068,7 @@ list(INSERT plugin_sources 0
endif()

if(UA_ENABLE_ENCRYPTION_OPENSSL OR UA_ENABLE_ENCRYPTION_LIBRESSL OR UA_ENABLE_AMALGAMATION)
list(INSERT plugin_sources 0
list(APPEND plugin_sources
${PROJECT_SOURCE_DIR}/plugins/crypto/openssl/securitypolicy_openssl_common.h
${PROJECT_SOURCE_DIR}/plugins/crypto/openssl/ua_openssl_version_abstraction.h
${PROJECT_SOURCE_DIR}/plugins/crypto/openssl/securitypolicy_openssl_common.c
Expand All @@ -1085,6 +1081,11 @@ list(INSERT plugin_sources 0
${PROJECT_SOURCE_DIR}/plugins/crypto/openssl/ua_pki_openssl.c)
endif()

# ua_securitypolicy_none.c requires UA_*_LoadCertificate() if encryption is enabled
list(APPEND plugin_sources
${PROJECT_SOURCE_DIR}/plugins/crypto/ua_pki_none.c
${PROJECT_SOURCE_DIR}/plugins/crypto/ua_securitypolicy_none.c)

if(UA_ENABLE_DISCOVERY)
list(APPEND lib_headers ${PROJECT_SOURCE_DIR}/src/server/ua_discovery.h)
list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_discovery.c)
Expand Down Expand Up @@ -1117,17 +1118,22 @@ endif()
set(UA_FILE_NODESETS) # List of nodeset-xml files to be considered in the generated information model
set(UA_NODESET_DIR ${PROJECT_SOURCE_DIR}/deps/ua-nodeset CACHE STRING "The path to the node-set directory (e.g. from https://github.com/OPCFoundation/UA-Nodeset)")

unset(UA_FILE_NS0_PRIVATE)
if(UA_FILE_NS0)
set(UA_FILE_NS0_PRIVATE "${UA_FILE_NS0}")
endif()

if(UA_NAMESPACE_ZERO STREQUAL "FULL")
# Use the "full" schema files also for datatypes and statuscodes
set(UA_SCHEMA_DIR ${UA_NODESET_DIR}/Schema CACHE INTERNAL "")

# Set the full Nodeset for NS0
if(NOT UA_FILE_NS0)
set(UA_FILE_NS0 ${UA_SCHEMA_DIR}/Opc.Ua.NodeSet2.xml CACHE INTERNAL "")
if(NOT UA_FILE_NS0_PRIVATE)
set(UA_FILE_NS0_PRIVATE ${UA_SCHEMA_DIR}/Opc.Ua.NodeSet2.xml)
endif()

# Check that the submodule was checked out or manually downloaded into the folder
if(NOT EXISTS "${UA_FILE_NS0}")
if(NOT EXISTS "${UA_FILE_NS0_PRIVATE}")
message(STATUS "Submodule update")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
RESULT_VARIABLE GIT_SUBMOD_RESULT)
Expand All @@ -1140,8 +1146,8 @@ else()
set(UA_SCHEMA_DIR ${PROJECT_SOURCE_DIR}/tools/schema CACHE INTERNAL "")

# Set the reduced Nodeset for NS0
if(NOT UA_FILE_NS0)
set(UA_FILE_NS0 ${UA_SCHEMA_DIR}/Opc.Ua.NodeSet2.Reduced.xml CACHE INTERNAL "")
if(NOT UA_FILE_NS0_PRIVATE)
set(UA_FILE_NS0_PRIVATE ${UA_SCHEMA_DIR}/Opc.Ua.NodeSet2.Reduced.xml CACHE INTERNAL "")
endif()

# Set feature-specific datatypes definitions and nodesets
Expand Down Expand Up @@ -1191,7 +1197,7 @@ else()
endif()
endif()

list(INSERT UA_FILE_NODESETS 0 "${UA_FILE_NS0}")
list(INSERT UA_FILE_NODESETS 0 "${UA_FILE_NS0_PRIVATE}")
set(UA_FILE_NODEIDS ${UA_SCHEMA_DIR}/NodeIds.csv)
set(UA_FILE_STATUSCODES ${UA_SCHEMA_DIR}/StatusCode.csv)
set(UA_FILE_TYPES_BSD ${UA_SCHEMA_DIR}/Opc.Ua.Types.bsd)
Expand All @@ -1217,7 +1223,6 @@ ua_generate_datatypes(INTERNAL NAME "transport" TARGET_SUFFIX "transport" NAMESP
# statuscode explanation
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.h
${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes.c
PRE_BUILD
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_statuscode_descriptions.py
${UA_FILE_STATUSCODES} ${PROJECT_BINARY_DIR}/src_generated/open62541/statuscodes
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/generate_statuscode_descriptions.py
Expand All @@ -1237,15 +1242,13 @@ add_custom_target(open62541-generator-statuscode DEPENDS
if(UA_ENABLE_AMALGAMATION)
# single-file release
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.h
PRE_BUILD
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
${OPEN62541_VERSION} ${CMAKE_CURRENT_BINARY_DIR}/open62541.h
${exported_headers} ${plugin_headers}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
${exported_headers} ${plugin_headers})

add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.c
PRE_BUILD
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py
${OPEN62541_VERSION} ${CMAKE_CURRENT_BINARY_DIR}/open62541.c
${lib_headers} ${lib_sources} ${plugin_sources} ${architecture_headers} ${architecture_sources}
Expand All @@ -1269,7 +1272,7 @@ if(UA_ENABLE_NODESET_INJECTOR)
message(STATUS "Nodesetinjector feature enabled")
cmake_minimum_required(VERSION 3.20)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/open62541/nodesetinjector.h
${PROJECT_BINARY_DIR}/src_generated/open62541/nodesetinjector.c PRE_BUILD
${PROJECT_BINARY_DIR}/src_generated/open62541/nodesetinjector.c
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/nodeset_injector/generate_nodesetinjector.py
${PROJECT_BINARY_DIR}/src_generated/open62541/nodesetinjector)
add_custom_target(open62541-generator-nodesetinjector DEPENDS
Expand Down Expand Up @@ -1321,7 +1324,7 @@ if(UA_ENABLE_AMALGAMATION)
open62541-generator-statuscode
open62541-amalgamation-source)

add_library(open62541 SHARED $<TARGET_OBJECTS:open62541-object>)
add_library(open62541 $<TARGET_OBJECTS:open62541-object>)
# the only directory that needs to be included if open62541 (amalgameted) target from
# the build directory is ${PROJECT_BINARY_DIR}, that contains the generated open62541.h
target_include_directories(open62541 PUBLIC $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>)
Expand Down
2 changes: 0 additions & 2 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ list(APPEND GENERATED_RST "")
# Generated type definitions
add_custom_command(OUTPUT ${DOC_SRC_DIR}/types_generated.rst
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/src_generated/open62541/types_generated.rst ${DOC_SRC_DIR}
PRE_BUILD
DEPENDS ${PROJECT_BINARY_DIR}/src_generated/open62541/types_generated.rst)
list(APPEND GENERATED_RST ${DOC_SRC_DIR}/types_generated.rst)

macro(generate_rst in out)
add_custom_command(OUTPUT ${out}
DEPENDS ${PROJECT_SOURCE_DIR}/tools/c2rst.py ${in}
PRE_BUILD
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/c2rst.py ${in} ${out})
list(APPEND GENERATED_RST "${out}")
endmacro()
Expand Down
2 changes: 1 addition & 1 deletion examples/discovery/server_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ int main(int argc, char **argv) {
// Enable the mDNS announce and response functionality
config->mdnsEnabled = true;

config->mdnsConfig.mdnsServerName = UA_String_fromChars("Sample Multicast Server");
config->mdnsConfig.mdnsServerName = UA_String_fromChars("Sample-Multicast-Server");

//setting custom outbound interface
config->mdnsInterfaceIP = UA_String_fromChars("0.0.0.0");
Expand Down
2 changes: 1 addition & 1 deletion examples/discovery/server_register.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int main(int argc, char **argv) {
UA_String_clear(&config->applicationDescription.applicationUri);
config->applicationDescription.applicationUri =
UA_String_fromChars("urn:open62541.example.server_register");
config->mdnsConfig.mdnsServerName = UA_String_fromChars("Sample Server");
config->mdnsConfig.mdnsServerName = UA_String_fromChars("Sample-Server");
// See http://www.opcfoundation.org/UA/schemas/1.04/ServerCapabilities.csv
//config.serverCapabilitiesSize = 1;
//UA_String caps = UA_String_fromChars("LDS");
Expand Down
4 changes: 0 additions & 4 deletions examples/encryption/server_encryption.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ int main(int argc, char* argv[]) {
"Missing arguments. Arguments are "
"<server-certificate.der> <private-key.der> "
"[<trustlist1.crl>, ...]");
#if defined(UA_ENABLE_ENCRYPTION_OPENSSL) || defined(UA_ENABLE_ENCRYPTION_LIBRESSL)
UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND,
"Trying to create a certificate.");
UA_String subject[3] = {UA_STRING_STATIC("C=DE"),
Expand All @@ -65,9 +64,6 @@ int main(int argc, char* argv[]) {
UA_StatusCode_name(statusCertGen));
return EXIT_SUCCESS;
}
#else
return EXIT_SUCCESS;
#endif
}


Expand Down
11 changes: 8 additions & 3 deletions examples/pubsub/tutorial_pubsub_mqtt_publish.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
#include <stdio.h>

#define CONNECTION_NAME "MQTT Publisher Connection"
#define TRANSPORT_PROFILE_URI "http://opcfoundation.org/UA-Profile/Transport/pubsub-mqtt"
#define TRANSPORT_PROFILE_URI_UADP "http://opcfoundation.org/UA-Profile/Transport/pubsub-mqtt-uadp"
#define TRANSPORT_PROFILE_URI_JSON "http://opcfoundation.org/UA-Profile/Transport/pubsub-mqtt-json"
#define MQTT_CLIENT_ID "TESTCLIENTPUBSUBMQTT"
#define CONNECTIONOPTION_NAME "mqttClientId"
#define PUBLISHER_TOPIC "customTopic"
Expand Down Expand Up @@ -104,8 +105,12 @@ addPubSubConnection(UA_Server *server, char *addressUrl) {
UA_PubSubConnectionConfig connectionConfig;
memset(&connectionConfig, 0, sizeof(connectionConfig));
connectionConfig.name = UA_STRING(CONNECTION_NAME);
connectionConfig.transportProfileUri = UA_STRING(TRANSPORT_PROFILE_URI);
connectionConfig.enabled = UA_TRUE;
if(useJson) {
connectionConfig.transportProfileUri = UA_STRING(TRANSPORT_PROFILE_URI_JSON);
} else {
connectionConfig.transportProfileUri = UA_STRING(TRANSPORT_PROFILE_URI_UADP);
}
connectionConfig.enabled = true;

/* configure address of the mqtt broker (local on default port) */
UA_NetworkAddressUrlDataType networkAddressUrl = {UA_STRING_NULL , UA_STRING(addressUrl)};
Expand Down
Loading

0 comments on commit d389e61

Please sign in to comment.