The backend "cert-only" does not support QSslKey Qt android
-
Greetings
I have a project am testing, at first i tested on Windows 10, and every thing was fine, then i tested it on windows 11, (Using the same machine but booting in different OSs), just after i finished testing it with windows 11, i could nolonger make network requests, i keet getting these errors...PLEASE I CHANGED NOTHING DURING THE TEST!
W qt.network.ssl: unknown unknown The backend "cert-only" does not support QSslKey W qt.network.ssl: unknown unknown Active TLS backend does not support key creation W qt.network.ssl: unknown unknown The backend "cert-only" does not support QSslKey W qt.network.ssl: unknown unknown Active TLS backend does not support key creation W qt.network.ssl: unknown unknown The backend "cert-only" does not support QSslSocket W qt.network.ssl: unknown unknown The backend named "cert-only" does not support TLS W qt.network.ssl: unknown unknown QSslSocket::connectToHostEncrypted: TLS initialization failed
i really don`t know what to doa next because i every time i make a request, i get
"TLS initialization failed"
here is how i have been linking the openssl in CMAKE
set_target_properties(${GW_LIBRARY_NAME} PROPERTIES QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android) list(APPEND android_extra_libs ${CMAKE_CURRENT_SOURCE_DIR}/../assets/libs/openssl/arm64/libcrypto_1_1.so ${CMAKE_CURRENT_SOURCE_DIR}/../assets/libs/openssl/arm64/libssl_1_1.so) set_target_properties(${GW_LIBRARY_NAME} PROPERTIES QT_ANDROID_EXTRA_LIBS "${android_extra_libs}")
I tried my code in a different Qt project on windows 10 and it successfully worked without any issues..
Please take note, everthing was working ...it just failed to work out of the blue after testing with windows 11,
Am using Qt 6.5, android ndk 25.And also, i noticed on forums recommending QSslSocket::sslLibraryBuildVersionString() and QSslSocket::sslLibraryVersionString() to get the openssl verstion used by qt...but when i tried it..i got totally different results
Here is my code
qDebug() << "My build Version String is - " << QSslSocket::sslLibraryBuildVersionString() << " " " and version string is " << QSslSocket::sslLibraryVersionString();
Here are my results...
"My build Version String is - "Secure Channel (NTDDI: 0xA00000C)" and version string is "Secure Channel, Windows 10.0.18363";
Any help please!
-
Hi,
Something is not clear.
Do you mean that the deployment on Androïd from Win10 is working properly but not from Win11 ?
Might be a silly question but are you sure the you have the arm based OpenSSL properly available on both systems ?
-
@SGaist said in The backend "cert-only" does not support QSslKey Qt android:
Might be a silly question but are you sure the you have the arm based OpenSSL properly available on both systems
Its not silly and am glad for your response....My answer is yes ...every thing was working wihout any issues, am using Android Qt 6.5.1 Clang arm64-v8a
@SGaist said in The backend "cert-only" does not support QSslKey Qt android:
Do you mean that the deployment on Androïd from Win10 is working properly but not from Win11 ?
The project is mainly target for both desktop and android...the desktop version is working fine...(no issues), but the same code when its run in android it fails...
When i try to get the openssl version used by qt by
qDebug() << "My build Version String is - " << QSslSocket::sslLibraryBuildVersionString() << " " " and version string is " << QSslSocket::sslLibraryVersionString();
:.....i get My build Version String is - "Secure Channel (NTDDI: 0xA00000C)" and version string is "Secure Channel, Windows 10.0.18363"..This output is for windows...but for android get an empty string for both functions!
-
I just realized, since Qt 6.5, it's OpenSSL 3 that is used by default. That would explain your issue since you are using 1.1.
-
K kkoehne has marked this topic as solved on
-
@Sheep, I am having the same error you had could you please guide me through how you resolve yours?
if(ANDROID)
add_library(test2 SHARED
${PROJECT_SOURCES}
)
set_properties(TARGET ${PROJECT_SOURCES} PROPERTY QT_ANDROID_EXTRA_LIBS
${PROJECT_SOURCES}/ui/assets/ssl_3/arm64-v8a/libcrypto_3.so
${PROJECT_SOURCES}/ui/assets/ssl_3/arm64-v8a/libssl_3.so)