Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT6.8.6 compatibility issue on iOS SDK 26.x OpenSSL

QT6.8.6 compatibility issue on iOS SDK 26.x OpenSSL

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 2 Posters 787 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CellCS
    wrote on last edited by CellCS
    #1

    Now build Qt 6.8.6 for iOS by using source code and openssl-apple (https://github.com/partout-io/openssl-apple)
    Xcode is 26.1:

    Purpose: Qt for iOS - Building from Source to support TLS 1.3 with using openssl
    Device: macOS 26.2.
    Xcode Version: 26.1
    Qt Host Version::Qt 6.8.6 (from online installer)
    Qt sources : qt-everywhere-src-6.8.6

    Steps:
    Step 1: Build OpenSSL 3.x for iOS first
    Clone the OpenSSL-Apple repository

    openssl-apple % ./build-libssl.sh --version=3.4.1 --targets="ios64-cross-arm64"
    

    Verify the output:

    ls openssl-apple/bin/iPhoneOS26.1-arm64.sdk/
    cmake		libcrypto.a	libssl.a	pkgconfig
    

    Step2 Qt Build Environment and Configure

    HOST_QT_PATH="$HOME/Qt/6.8.6/macos"
    OPENSSL_APPLE_PATH="$HOME/Qt/openssl-apple/bin/iPhoneOS26.1-arm64.sdk"
    QT_IOS_INSTALL_PATH="$HOME/Qt/6.8.6ios"
    OPENSSL_USE_STATIC_LIBS=ON
    

    Then configure

    ../qt-everywhere-src-6.8.6/configure \
    -platform macx-ios-clang  \
    -sdk iphoneos \
    -qt-host-path "${HOST_QT_PATH}" \
    -release \
    -static \
    -opensource -confirm-license \
    -nomake tests -nomake examples \
    -skip qtwebengine -skip qtlocation -skip qtprotobuf -skip qtgrpc -skip qtlanguage-server \
    -openssl-linked \
    -no-securetransport \
    -prefix "${QT_IOS_INSTALL_PATH}" \
    -- \
    -DOPENSSL_ROOT_DIR="${OPENSSL_APPLE_PATH}" \
    -DOPENSSL_USE_STATIC_LIBS=ON
    

    During this process, found some warnings, one of these is:

    CMake Warning at qtbase/cmake/QtPublicAppleHelpers.cmake:1087 (message):
    Qt has only been tested with version 18 of the platform SDK, you're using
    26.1. This is an unsupported configuration. You may experience build
    issues, and by using the 26.1 SDK you are opting in to new features that Qt
    has not been prepared for. Please downgrade the SDK you use to build your
    app to version 18, or configure with -DQT_NO_APPLE_SDK_MAX_VERSION_CHECK=ON
    to silence this warning.

    Step 3: CMake

    cmake --build . --parallel --verbose
    

    Errors:

    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:458:20: error: use of undeclared identifier 'PEM_read_bio_DSA_PUBKEY'; did you mean 'PEM_read_bio_RSA_PUBKEY'?
      458 | DEFINEFUNC4(DSA *, PEM_read_bio_DSA_PUBKEY, BIO *a, a, DSA **b, b, pem_password_cb *c, c, void *d, d, return nullptr, return)
          |                    ^~~~~~~~~~~~~~~~~~~~~~~
          |                    PEM_read_bio_RSA_PUBKEY
    
    
          |                                                       ^
    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:460:20: error: use of undeclared identifier 'PEM_read_bio_DSAPrivateKey'; did you mean 'PEM_read_bio_RSAPrivateKey'?
      460 | DEFINEFUNC4(DSA *, PEM_read_bio_DSAPrivateKey, BIO *a, a, DSA **b, b, pem_password_cb *c, c, void *d, d, return nullptr, return)
          |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
          |                    PEM_read_bio_RSAPrivateKey
    
    
      /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:460:68: error: cannot initialize a parameter of type 'RSA **' (aka 'rsa_st **') with an lvalue of type 'DSA **' (aka 'dsa_st **')
      460 | DEFINEFUNC4(DSA *, PEM_read_bio_DSAPrivateKey, BIO *a, a, DSA **b, b, pem_password_cb *c, c, void *d, d, return nullptr, return)
    
    
      /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:463:18: error: use of undeclared identifier 'PEM_write_bio_DSA_PUBKEY'; did you mean 'PEM_write_bio_RSA_PUBKEY'?
      463 | DEFINEFUNC2(int, PEM_write_bio_DSA_PUBKEY, BIO *a, a, DSA *b, b, return 0, return)
          |                  ^~~~~~~~~~~~~~~~~~~~~~~~
          |                  PEM_write_bio_RSA_PUBKEY
    
    
      /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:463:63: error: cannot initialize a parameter of type 'const RSA *' (aka 'const rsa_st *') with an lvalue of type 'DSA *' (aka 'dsa_st *')
      463 | DEFINEFUNC2(int, PEM_write_bio_DSA_PUBKEY, BIO *a, a, DSA *b, b, return 0, return)
    
    
      /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:465:18: error: use of undeclared identifier 'PEM_write_bio_DSAPrivateKey'; did you mean 'PEM_write_bio_RSAPrivateKey'?
      465 | DEFINEFUNC7(int, PEM_write_bio_DSAPrivateKey, BIO *a, a, DSA *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return)
          |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                  PEM_write_bio_RSAPrivateKey
    
      /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:465:66: error: cannot initialize a parameter of type 'const RSA *' (aka 'const rsa_st *') with an lvalue of type 'DSA *' (aka 'dsa_st *')
      465 | DEFINEFUNC7(int, PEM_write_bio_DSAPrivateKey, BIO *a, a, DSA *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return)
    
    
      /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:470:19: error: use of undeclared identifier 'DSA_new'; did you mean 'RSA_new'?
      470 | DEFINEFUNC(DSA *, DSA_new, DUMMYARG, DUMMYARG, return nullptr, return)
          |                   ^~~~~~~
          |                   RSA_new
    
    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:470:19: error: cannot initialize return object of type 'DSA *' (aka 'dsa_st *') with an rvalue of type 'RSA *' (aka 'rsa_st *')
      470 | DEFINEFUNC(DSA *, DSA_new, DUMMYARG, DUMMYARG, return nullptr, return)
    
    
    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:471:18: error: use of undeclared identifier 'DSA_free'; did you mean 'RSA_free'?
      471 | DEFINEFUNC(void, DSA_free, DSA *a, a, return, DUMMYARG)
          |                  ^~~~~~~~
          |                  RSA_free
    
    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:471:36: error: cannot initialize a parameter of type 'RSA *' (aka 'rsa_st *') with an lvalue of type 'DSA *' (aka 'dsa_st *')
      471 | DEFINEFUNC(void, DSA_free, DSA *a, a, return, DUMMYARG)
    
    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:477:17: error: use of undeclared identifier 'DSA_bits'; did you mean 'RSA_bits'?
      477 | DEFINEFUNC(int, DSA_bits, DSA *a, a, return 0, return)
          |                 ^~~~~~~~
          |                 RSA_bits
    
    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:477:35: error: cannot initialize a parameter of type 'const RSA *' (aka 'const rsa_st *') with an lvalue of type 'DSA *' (aka 'dsa_st *')
      477 | DEFINEFUNC(int, DSA_bits, DSA *a, a, return 0, return)
    
    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:480:19: error: use of undeclared identifier 'EVP_PKEY_get1_DSA'; did you mean 'EVP_PKEY_get1_RSA'?
      480 | DEFINEFUNC(DSA *, EVP_PKEY_get1_DSA, EVP_PKEY *a, a, return nullptr, return)
          |                   ^~~~~~~~~~~~~~~~~
          |                   EVP_PKEY_get1_RSA
    
    
    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:480:19: error: cannot initialize return object of type 'DSA *' (aka 'dsa_st *') with an rvalue of type 'struct rsa_st *'
      480 | DEFINEFUNC(DSA *, EVP_PKEY_get1_DSA, EVP_PKEY *a, a, return nullptr, return)
    
    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:488:18: error: use of undeclared identifier 'EVP_PKEY_set1_DSA'; did you mean 'EVP_PKEY_set1_RSA'?
      488 | DEFINEFUNC2(int, EVP_PKEY_set1_DSA, EVP_PKEY *a, a, DSA *b, b, return -1, return)
          |                  ^~~~~~~~~~~~~~~~~
          |                  EVP_PKEY_set1_RSA
    
    /Users/admin/qt-everywhere-src-6.8.6/qtbase/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp:488:61: error: cannot initialize a parameter of type 'struct rsa_st *' with an lvalue of type 'DSA *' (aka 'dsa_st *')
      488 | DEFINEFUNC2(int, EVP_PKEY_set1_DSA, EVP_PKEY *a, a, DSA *b, b, return -1, return)
    
    
    18 errors generated.
    make[2]: *** [qtbase/src/plugins/tls/openssl/CMakeFiles/QTlsBackendOpenSSLPlugin.dir/qsslsocket_openssl_symbols.cpp.o] Error 1
    make[1]: *** [qtbase/src/plugins/tls/openssl/CMakeFiles/QTlsBackendOpenSSLPlugin.dir/all] Error 2
    make: *** [all] Error 2
    

    most about :
    use of undeclared identifier 'PEM_read_bio_DSA_PUBKEY'
    use of undeclared identifier 'DSA_new'
    EVP_PKEY_get1_DSA
    EVP_PKEY_set1_DSA
    DSA_bit

    Also tried with configuration adding "-DQT_FEATURE_openssl_dsa=OFF", does not help.

    Questions:
    For qt 6.8.6, whether will try Patch qsslsocket_openssl_symbols.cpp to skip DSA ?

    then Wrapping all DSA-related symbols in side

    #ifndef OPENSSL_NO_DEPRECATED_3_0
    #ifndef OPENSSL_NO_DSA
        // all DSA-related DEFINEFUNC(...)
    #endif // OPENSSL_NO_DSA
    #endif
    

    ? Question: Here, I still leave OPENSSL_NO_DEPRECATED_3_0 as it, but it may be unnecessary??

    This is diff that I modified compared with original file:

    ca3583ce-db6f-4e3b-be38-459669288449-image.png

    Re configure, and build

    meet

    /opt/homebrew/opt/llvm/bin/llvm-ranlib ../../../qtbase/lib/libQt6MultimediaTestLib.a
    [ 50%] Built target MultimediaTestLibPrivate
    /Users/admin/DevTools/QtSources/qt-everywhere-src-6.8.6/qtopcua/src/3rdparty/open62541/open62541.c:66319:24: error: call to undeclared function 'X509_get_notBefore'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     66319 |     if(X509_gmtime_adj(X509_get_notBefore(x509), 0) == NULL) {
           |                        ^
    /Users/admin/DevTools/QtSources/qt-everywhere-src-6.8.6/qtopcua/src/3rdparty/open62541/open62541.c:66319:24: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'ASN1_TIME *' (aka 'struct asn1_string_st *') [-Wint-conversion]
     66319 |     if(X509_gmtime_adj(X509_get_notBefore(x509), 0) == NULL) {
           |                        ^~~~~~~~~~~~~~~~~~~~~~~~
    /Users/admin/opensources/openssl-apple/bin/iPhoneOS26.1-arm64.sdk/include/openssl/x509.h:702:39: note: passing argument to parameter 's' here
      702 | ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj);
          |                                       ^
    /Users/admin/DevTools/QtSources/qt-everywhere-src-6.8.6/qtopcua/src/3rdparty/open62541/open62541.c:66326:24: error: call to undeclared function 'X509_get_notAfter'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     66326 |     if(X509_gmtime_adj(X509_get_notAfter(x509), (UA_Int64) 60 * 60 * 24 * 365) == NULL) {
           |                        ^
    /Users/admin/DevTools/QtSources/qt-everywhere-src-6.8.6/qtopcua/src/3rdparty/open62541/open62541.c:66326:24: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'ASN1_TIME *' (aka 'struct asn1_string_st *') [-Wint-conversion]
     66326 |     if(X509_gmtime_adj(X509_get_notAfter(x509), (UA_Int64) 60 * 60 * 24 * 365) == NULL) {
           |                        ^~~~~~~~~~~~~~~~~~~~~~~
    /Users/admin/opensources/openssl-apple/bin/iPhoneOS26.1-arm64.sdk/include/openssl/x509.h:702:39: note: passing argument to parameter 's' here
      702 | ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj);
    

    it’s coming from open62541, the OPC UA library included in Qt OPC UA (qtopcua/src/3rdparty/open62541).

    call to undeclared function 'X509_get_notBefore'
    call to undeclared function 'X509_get_notAfter'

    ? Question: whether this is because Qt 6.8.6 includes open62541, which calls legacy OpenSSL APIs that are removed in OpenSSL 3.x / openssl-apple.

    Then Patch open62541 in Qt source
    Inside qtopcua/src/3rdparty/open62541/open62541.c around lines 66319–66326:

    #if OPENSSL_VERSION_NUMBER < 0x30000000L
        if (X509_gmtime_adj(X509_get_notBefore(x509), 0) == NULL) { ... }
        if (X509_gmtime_adj(X509_get_notAfter(x509), 60*60*24*365) == NULL) { ... }
    #else
        // OpenSSL 3.x compatible
        if (X509_gmtime_adj((ASN1_TIME*)X509_get0_notBefore(x509), 0) == NULL) { ... }
        if (X509_gmtime_adj((ASN1_TIME*)X509_get0_notAfter(x509), 60*60*24*365) == NULL) { ... }
    #endif
    

    also add "-skip qtopcua" in configure

    modification (right) vs. original file (left)

    8aa8cae2-ba54-43c6-bda3-deb69b1d654d-image.png

    Then execute configure, cmake --build . --parallel --verbose, and "cmake --install ."

    All good, and create qt 6.8.6ios folder, then use Xcode to build a qt mobile example with a tls 1.3 request by loading pem file.

    Get Error
    8f133d00-bfcd-4ae0-b8e0-8dbbebce045d-image.png

    Summary: : Build Qt 6.8.6 iOS against OpenSSL built with iOS 18.x SDK instead of iOS 26.x SDK

    Issue/Bug: building Qt 6.8.6 against: Xcode 26.1 (iPhoneOS 26.1 SDK) with OpenSSL built for iPhoneOS 26.1
    This combination exposed OpenSSL API incompatibilities (especially around DSA and deprecated symbols), which Qt 6.8.6 does not fully handle yet on iOS.
    so have issues in :

    • q_DSA_* undefined symbols
    • X509_get_notBefore / notAfter issues
    • CMake flags like QT_FEATURE_openssl_dsa=OFF being ignored or insufficient.

    One solution:

    • OpenSSL built for iPhoneOS 18.5 (The same OpenSSL that I previously used successfully with Qt 5.15)
    • Still using Qt 6.8.6
    • Still using Xcode 26.1
    • No Qt source code patches (does not need to modify source files as above on DSA....)

    This is working maybe because:
    iOS SDK 18.5 OpenSSL
    Still exposes legacy OpenSSL APIs Qt 6.8.6 expects
    No missing q_DSA_* wrapper symbols
    No OpenSSL 3.x symbol removals that Qt hasn’t fully guarded yet
    🔹 Qt 6.8.6 + iOS 18.5 OpenSSL = Compatible
    Even when built with a newer Xcode, the OpenSSL headers/libs define the ABI, not Xcode itself.

    Final Conclusion
    This is a Qt 6.8.6 + iOS 26.x OpenSSL compatibility gap

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What is your issue with this warning ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CellCS
        wrote on last edited by
        #3

        Hi @SGaist, thanks for your kind help, please check, I updated original issue with more details. thanks again.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          From a quick search, it looks like PEM_read_bio_DSA_PUBKEY is deprecated so your build of OpenSSL might have dropped that symbol.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • C Offline
            C Offline
            CellCS
            wrote last edited by CellCS
            #5

            @SGaist thanks a lot, I updated original post with more details, please check, thanks for your kind help and support. and this is Qt 6.8.6 compatibility issue on iOS SDK 26.x OpenSSL

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote last edited by
              #6

              Next step I would recommend: use a more recent version of Qt. 6.8 is already pretty old.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • C Offline
                C Offline
                CellCS
                wrote last edited by
                #7

                yes, agree. will seek for qt upgrading.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved