Qt 5.3.2 on IOS with OpenSSL
-
Hi all,
My app needs OpenSSL, but on iOS OpenSSL is not available so QSslSocket is undefined symbol. (Qt 5.3.1 for iOS, QtCreator 3.2.0)
I was able to compile openssl libs and statically linked Qt 5.3.2 using this help "openssl config for iphoneos":https://bugreports.qt-project.org/browse/QTBUG-36891
instead of git I have used qt-everywhere-opensource-src-5.3.2
Everything works fine on the device.My configure option for Qt was:
./configure -v -prefix /Users/administrator/dev/qt-5.3.2-ios-ipad -xplatform macx-ios-clang -debug-and-release -opensource -confirm-license -static -nomake tests -nomake examples -skip qtdeclarative -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -skip multimedia -openssl-linked -I/Users/administrator/dev/openssl-1.0.1e/include -L/Users/administrator/dev/openssl-1.0.1e/lib -lcrypto -lsslWhat bothers me is that this is static build of Qt and I don't have commercial license, so the question is:
- Can it be build as dynamically linked Qt but with openssl compiled in. ?
- If not how can I get Qt working with OpenSSL on iOS, my app is using custom CA certificates and validation.
- Has anyone been testing dynamically linked Qt apps in App Store ? I mean do they allow such an applications to be published?
Best Regards
Marek -
Hey Marek, we have a dynamic linked Mac App on the AppStore - so yes, you can publish it. However it currently is quite some work to get codesign to do it right - so plan on some sleepless nights to get this working. There are several open tickets for this to get some background information:
https://bugreports.qt-project.org/browse/QTBUG-32896
https://bugreports.qt-project.org/browse/QTBUG-23268
https://bugreports.qt-project.org/browse/QTBUG-34810 -
Thanks for reply.
To be honest I converted my project to Xcode, to be able to choose orientation, icon, icon caption and so on. It looks like it should be quite easy to sign application from Xcode? I can see that these bugs are related to macdeployqt, so are you doing everything from QtCreator?And how about this compilation issue?
Can I compile dynamically linked Qt with openssl compiled into QtNetwork ?
Are you using OpenSSL?All the best,
Marek -
I can't build shared Qt, everytime even if I specyfically use "-shared" option to configure, it keeps building static Qt. I have Mac OS X 10.9 and Qt 5.3.2 configure option is:
@
./configure -v -prefix /Users/administrator/qt-5.3.2-ios-ipad-dyn2 -xplatform macx-ios-clang -debug-and-release -shared -opensource -confirm-license -nomake tests -nomake examples -skip qtdeclarative -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -skip multimedia -openssl-linked -I/Users/administrator/openssl-ios-arm/include/ -L/Users/administrator/openssl-ios-arm/lib/ -lcrypto -lssl
@configure status is:
@
Building on: macx-clang (x86_64, CPU features: cx16 mmx sse sse2 sse3 ssse3)
Building for: macx-ios-clang (arm, CPU features: neon)qmake vars .......... styles += mac fusion windows DEFINES += QT_NO_MTDEV DEFINES += QT_NO_LIBUDEV DEFINES += QT_NO_EVDEV INCLUDEPATH += "/Users/administrator/openssl-ios-arm/include/" LIBS += -L"/Users/administrator/openssl-ios-arm/lib/" -l"crypto" -l"ssl" sql-drivers = sql-plugins = sqlite qmake switches .........
Build options:
Configuration .......... accessibility audio-backend build_all build_all c++11 compile_examples concurrent cross_compile debug debug_and_release freetype full-config getaddrinfo getifaddrs gif harfbuzz iconv ipv6ifname jpeg large-config largefile medium-config minimal-config no-pkg-config opengl opengles2 openssl-linked pcre png precompile_header qpa qpa reduce_exports release small-config static system-zlib
Build parts ............ libs
Mode ................... debug and release; default link: debug
Using C++11 ............ yes
Using PCH .............. yes
Target compiler supports:
iWMMXt/Neon .......... no/autoQt modules and options:
Qt D-Bus ............... no
Qt Concurrent .......... yes
Qt GUI ................. yes
Qt Widgets ............. yes
Large File ............. yes
QML debugging .......... yes
Use system proxies ..... noSupport enabled for:
Accessibility .......... yes
ALSA ................... no
CUPS ................... no
Evdev .................. no
FontConfig ............. no
FreeType ............... yes (bundled copy)
Glib ................... no
GTK theme .............. no
HarfBuzz ............... yes
Iconv .................. yes
ICU .................... no
Image formats:
GIF .................. yes (in QtGui, using bundled copy)
JPEG ................. yes (in QtGui, using bundled copy)
PNG .................. yes (in QtGui, using bundled copy)
journald ............... no
mtdev .................. no
Networking:
CoreWlan ............. no
getaddrinfo .......... yes
getifaddrs ........... yes
IPv6 ifname .......... yes
OpenSSL .............. yes (linked to the libraries)
NIS .................... no
OpenGL / OpenVG:
EGL .................. no
OpenGL ............... yes (OpenGL ES 2.x)
OpenVG ............... no
PCRE ................... yes (bundled copy)
pkg-config ............. no
PulseAudio ............. no
QPA backends:
DirectFB ............. no
EGLFS ................ no
KMS .................. no
LinuxFB .............. no
XCB .................. no
Session management ..... yes
SQL drivers:
DB2 .................. no
InterBase ............ no
MySQL ................ no
OCI .................. no
ODBC ................. no
PostgreSQL ........... no
SQLite 2 ............. no
SQLite ............... yes (plugin, using bundled copy)
TDS .................. no
udev ................... no
xkbcommon .............. no
zlib ................... yes (system library)WARNING: Using static linking will disable the use of dynamically
loaded plugins. Make sure to import all needed static plugins,
or compile needed modules into the library.NOTE: When linking against OpenSSL, you can override the default
library names through OPENSSL_LIBS.
For example:
OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linkedNOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1.
Configure with '-qreal float' to create a build that is binary compatible with 5.1.
Info: creating super cache file /Users/administrator/Documents/franki/dynamic/qt-everywhere-opensource-src-5.3.2/.qmake.super
Info: creating stash file /Users/administrator/Documents/franki/dynamic/qt-everywhere-opensource-src-5.3.2/.qmake.stashQt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into /Users/administrator/qt-5.3.2-ios-ipad-dyn2
@But I only need to compile OpenSSL into QtNetwork module, why configure makes static build of Qt ?
best regards
Marek -
Hi,
Because until iOS 8 you couldn't have dynamic frameworks in your iOS application bundle.
-
It's more about App Store rules than SDK. But yes, you don't need to worry about the fact that the build is currently set to static. However, don't forget the licensing issue that come with it.
-
licensing issue is what worries me ;)
My app is for free, its a demo, but I don't want to publish source code. On the net I have read that if I provide objects files to re-link application it is then enough. Like in this thread "Your text to link here...":http://qt-project.org/forums/viewthread/33475But actually many people says many things about it.
-
Since it's for iOS you could consider the new Indie License, or check about the status of the shared version of Qt for iOS 8 on the interest mailing list
-
You're welcome, happy coding !