Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems when enabling encryption as flag in cmake command #6420

Open
2 of 7 tasks
muurc opened this issue Apr 17, 2024 · 4 comments
Open
2 of 7 tasks

Problems when enabling encryption as flag in cmake command #6420

muurc opened this issue Apr 17, 2024 · 4 comments

Comments

@muurc
Copy link

muurc commented Apr 17, 2024

Description

I have troubles enabling encryption with openssl when building the open62541 lib. It doesnt show me any error when running the cmake command itself, however, when I am calling the make command the terminal says pretty fast:

ua_eventfilter_grammar.leg:30343:1: error: conflicting types for ‘UA_OpenSSL_LoadLocalCertificate’

OpenSSL is installed(libssl-dev), I am using ubuntu 20.04.6 LTS.

Background Information / Reproduction Steps

Configuring building flags

Used CMake options:

cmake 
-DCMAKE_BUILD_TYPE=RelWithDebInfo 
-DUA_ENABLE_NODEMANAGEMENT=ON 
-DUA_ENABLE_ENCRYPTION=ON 
-DUA_ENABLE_ENCRYPTION_OPENSSL=ON 
-DUA_MULTITHREADING=ON 
-DUA_NAMESPACE_ZERO=FULL 
-DUA_ENABLE_AMALGAMATION=ON 
-DUA_ENABLE_SUBSCRIPTIONS=ON 
-DUA_ENABLE_PUBSUB=ON 
-DUA_ENABLE_MULTITHREADING=ON ..

Checklist

Please provide the following information:

  • open62541 Version (release number or git tag): 1.4.0
  • Other OPC UA SDKs used (client or server):
  • Operating system: Ubuntu 20.04.06 LTS
  • Logs (with UA_LOGLEVEL set as low as necessary) attached
  • Wireshark network dump attached
  • Self-contained code example attached
  • Critical issue
@jpfr
Copy link
Member

jpfr commented Apr 17, 2024

Something is very wrong here.
The file ua_eventfilter_grammar.leg does not have 30k lines.

@muurc
Copy link
Author

muurc commented Apr 17, 2024

Well I downloaded the source again from github and was successful with the compilation of the lib. However, now when I try to compile everything(parameters: -lssl -lcrypto -I/usr/lib/ssl), it shows me a lot of undefined reference errors. Do I need to have a specific openssl version? I have installed the latest one.

Here are some of the undefined ref errors:

/usr/bin/ld: open62541.o: in function sk_X509_num': /usr/include/openssl/x509.h:99: undefined reference to OPENSSL_sk_num'
/usr/bin/ld: open62541.o: in function sk_X509_value': /usr/include/openssl/x509.h:99: undefined reference to OPENSSL_sk_value'
/usr/bin/ld: open62541.o: in function sk_X509_new_null': /usr/include/openssl/x509.h:99: undefined reference to OPENSSL_sk_new_null'
/usr/bin/ld: open62541.o: in function sk_X509_push': /usr/include/openssl/x509.h:99: undefined reference to OPENSSL_sk_push'

@jpfr
Copy link
Member

jpfr commented Apr 23, 2024

I think you need to add -lx509…

@muurc
Copy link
Author

muurc commented Apr 23, 2024

I rebuilt the project and the issue was solved after I added the correct parameters for OpenSSL. I woul have another question although, I followed the example of "server_encryption.c". However the terminal still tells the following:
x509 Certificate Authentication configured, but no encrypting SecurityPolicy. This can leak credentials on the network.

So my question is, didnt I corretly added the policy, and if not how can I add it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants