Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. OpenSSL and Mac OS X
QtWS25 Last Chance

OpenSSL and Mac OS X

Scheduled Pinned Locked Moved Solved Installation and Deployment
mac os xopensslqt 5.5.0
7 Posts 3 Posters 15.0k Views
  • 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.
  • B Offline
    B Offline
    BugraK
    wrote on 30 Jun 2015, 13:39 last edited by A Former User
    #1

    Hello,

    Most of you know that OpenSSL libraries on Mac OS X are outdated. It may not be a big security issue, but it creates SSL errors when browsing internet. I read through these forums and other places and decided to update OpenSSL libraries on my Mac then linking them to Qt so when I make a distributable package it comes with updated OpenSSL libraries.

    I followed the instructions on this page and updated my OpenSSL packages using Homebrew and put them to the system place /usr/bin/openssl so system use them as default OpenSSL libraries.

    Then I complied Qt 5.5.0 RC from source ./configure -linked-openssl -prefix ~/Qt5.5.0-RC

    It all went fine. After compile finished I used CMake to build the application then used macdeployqt to make a Mac package.

    But when I try my package in a VM which contains outdated OpenSSL libraries (0.9.8y), I saw that application uses the system libraries, not the updated ones (1.0.2c).

    So what am I missing? I want to include updated OpenSSL libraries in my package.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Paul H.
      wrote on 30 Jun 2015, 14:49 last edited by
      #2

      It sounds like it is using shared openssl instead of statically linked. I can't tell from the link you posted if the update procedure for openssl installs the static libs. Make sure you have them in the openssl lib directory, and make sure the Qt build finds them by using OPENSSL_LIBS="-L<your_path_to_openssl_lib> -lcrypto -lssl" in configure options. That works on Windows for Qt 5.4.2, I don't know if it is the same on Mac with Qt 5.5.0. Your configure option is different than I use (I use -openssl-linked instead of -linked-openssl), so other things may be different, as well.
      Paul

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BugraK
        wrote on 3 Jul 2015, 12:43 last edited by BugraK 7 Mar 2015, 18:47
        #3

        Thanks for your help. I used -openssl-linked too, I just made typing error :) After a couple of days of trying and lots of research on internet, I finally succeeded.

        I have read that on Mac OS X you should omit -L, -lcrypto and -lssl because XCode doesn’t understand that as it should be. Instead you must give direct path to libssl.a and libcrypto.a static libs. So I -kind of- followed that advice and use this command.

        OPENSSL_LIBS="/usr/local/Cellar/openssl/1.0.2c/lib/libcrypto.a /usr/local/Cellar/openssl/1.0.2c/lib/libssl.a -lcrypto -lssl" ./configure -v -nomake examples -nomake tests -openssl-linked -prefix ~/Qt5.5.0-RC

        I advice Mac users who are in same situation as me to try either OPENSSL_LIBS="<your_path_to_libcrypto.a> <your_path_to_libssl.a> -lcrypto -lssl" or OPENSSL_LIBS="<your_path_to_libcrypto.a> <your_path_to_libssl.a>"

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 3 Jul 2015, 22:43 last edited by
          #4

          Hi and welcome to devnet,

          IIRC starting with Qt 5.5.0, you can use OS X/iOS native backend in place of OpenSSL but you have to rebuild Qt for that.

          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
          • B Offline
            B Offline
            BugraK
            wrote on 4 Jul 2015, 12:26 last edited by
            #5

            Thanks for the info. I read that this is going to be default in Qt 5.6. So how can I build Qt for this? Is regular build without -openssl-linked parameter enable this function?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 4 Jul 2015, 20:59 last edited by
              #6

              IIRC you must use the securetransport option

              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
              • B Offline
                B Offline
                BugraK
                wrote on 11 Jul 2015, 13:08 last edited by
                #7

                Thanks, -no-openssl -securetransport works. Now I can use Mac OS X native secure transport instead of OpenSSL.

                1 Reply Last reply
                0

                3/7

                3 Jul 2015, 12:43

                • Login

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