Skip to contentSkip to conversation

openssl: export OPENSSL_MODULES in SDK

PATCH In review Chen Qi 2 participants 2 messages Sep 27, 2022

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

PATCH 1/1 openssl: export OPENSSL_MODULES in SDK

In current SDK, when running the following command in python shell, we get an error.

$ python3
Quoted 1 line
Quoted 1 line
Quoted 1 line

from cryptography.hazmat.backends import openssl

The error message is as below:

cryptography.exceptions.InternalError: Unknown OpenSSL error.

We could set OPENSSL_MODULES explicitly in nativesdk-openssl package so that when SDK is set up, it's in environment and we can get rid of the above error.

---
 meta/recipes-connectivity/openssl/files/environment.d-openssl.sh | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-connectivity/openssl/files/environment.d-openssl.sh +1 -0
index b9cc24a7ac..1a03556f3b 100644
@@ -1 +1,2 @@
 export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf"
+export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/"
Signature · 1 line
2.37.1
#1 lore raw

Hi,

Quoted 25 lines · Chen Qi

In current SDK, when running the following command in python shell, we get an error.

$ python3
Quoted 1 line
Quoted 1 line
Quoted 1 line

from cryptography.hazmat.backends import openssl

The error message is as below:

cryptography.exceptions.InternalError: Unknown OpenSSL error.

We could set OPENSSL_MODULES explicitly in nativesdk-openssl package so that when SDK is set up, it's in environment and we can get rid of the above error.

---
 meta/recipes-connectivity/openssl/files/environment.d-openssl.sh | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-connectivity/openssl/files/environment.d-openssl.sh +0 -0
index b9cc24a7ac..1a03556f3b 100644

meta/recipes-connectivity/openssl/files/environment.d-openssl.sh line 2

Quoted 2 lines
meta/recipes-connectivity/openssl/files/environment.d-openssl.sh +1 -0
@@ -1 +1,2 @@
 export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf"
+export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/"

Also needs SSL_CERT_DIR, SSL_CERT_FILE and OPENSSL_ENGINES variables to be set.

Sadly all these are needed for openssl to work correctly.

Cheers,

-Mikko