Skip to contentSkip to conversation

openssl: export necessary env vars in SDK

PATCH New Chen Qi 1 participant 1 message Oct 19, 2022

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

PATCH v2 1/1 openssl: export necessary env vars 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.

Also, there are other env vars that need to be exported. And we export all of them to keep sync with openssl-native.bbclass.

---
 .../openssl/files/environment.d-openssl.sh                    | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-connectivity/openssl/files/environment.d-openssl.sh +4 -0
index b9cc24a7ac..516bbd1c56 100644
@@ -1 +1,5 @@
 export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf"
+export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/certs"
+export SSL_CERT_FILE="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/cert.pem"
+export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/"
+export OPENSSL_ENGINES="$OECORE_NATIVE_SYSROOT/usr/lib/engines-3"
Signature · 1 line
2.37.1