Building Qt 5.15 with wolfSSL Support

Did you know that you can build Qt 5.15 against the wolfSSL embedded SSL/TLS library instead of the default OpenSSL backend? Using wolfSSL as the TLS provider in Qt offers many advantages depending on application and industry. Some of these may include:

To compile wolfSSL for Qt, use the following configure options:

$ cd wolfssl
$ ./autogen.sh
$ ./configure  --enable-qt --enable-qt-test --enable-alpn --enable-rc2 --prefix=/path/to/wolfssl-install\
 CFLAGS="-DWOLFSSL_ERROR_CODE_OPENSSL -DWOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS=0x1b"
$ make
$ make install

Depending on the environment, adding wolfSSL install path to LD_LIBRARY_PATH for Qt build

LD_LIBRARY_PATH=/path/to/wolfssl\install/lib:$LD_LIBRARY_PATH

To compile Qt with the wolfSSL follow the steps below:

  1. Follow the Building Qt Guide to download needed Qt dependencies and initialize the Qt repository. To clone Qt for v5.15.x, you can use the following command:
    $ git clone git://code.qt.io/qt/qt5.git --branch v5.15.x
    
  2. Init Qt repository
    $ cd qt5
    $ ./init-repository --module-subset=qtbase
    
  3. Apply the wolfSSL Qt patch file to qt5.
    $ wget https://raw.githubusercontent.com/wolfSSL/osp/master/qt/wolfssl-qt-515.patch
    $ cd qtbase
    $ git apply -v ../wolfssl-qt-515.patch
    
  4. Configure Qt5
    $ cd ../../
    $ mkdir build
    $ cd ./build
    $ ../qt5/configure -opensource -wolfssl-linked -confirm-license -ccache -no-pch -developer-build -I/path/to/wolfssl-install/include/wolfssl -I/path/to/wolfssl-install/include
    
  5. Build Qt
    $ make
    

To find more detailed steps and then run test cases, you can find them in README at our ops repository.

If you have questions about any of the above, feel free to email us at facts@wolfSSL.com or support@wolfSSL.com, or call us at +1 425 245 8247.

Download wolfSSL Now