Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Proper deployment of Qt app (requiring SSL) on MacOS
QtWS25 Last Chance

Proper deployment of Qt app (requiring SSL) on MacOS

Scheduled Pinned Locked Moved Unsolved General and Desktop
macosssl
12 Posts 3 Posters 1.7k 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.
  • Romain CR Offline
    Romain CR Offline
    Romain C
    wrote on last edited by
    #1

    Hi everyone,
    I just need a little tips on Qt and MacOS software deployment. The software require some https request, and I know that using OpenSSL for Win and Linux is the right thing to do. For MacOS, I'm little bit stuck.

    I know that OS X require SecureTransport, but when I share my app to other MacOsX, requests are not performed, that mean missing ressources. Should I embed some dylibs in the .app ?
    Best regards

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

      Hi,

      How are you deploying your application ?
      What kind of SSL powered request are you doing ?

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

      Romain CR 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        How are you deploying your application ?
        What kind of SSL powered request are you doing ?

        Romain CR Offline
        Romain CR Offline
        Romain C
        wrote on last edited by
        #3

        @SGaist Thanks a lot for your answer =)
        Basically, I'm using the Qt Installer Framework for that purpose, outputting a .dmg.
        About the SSL, I'm performing an https request on our server.

        Does these elements answered your questions?

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

          AFAIK, you shouldn't need to do anything special. Which version of macOS are you seeing that on ?

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

          Romain CR 1 Reply Last reply
          0
          • SGaistS SGaist

            AFAIK, you shouldn't need to do anything special. Which version of macOS are you seeing that on ?

            Romain CR Offline
            Romain CR Offline
            Romain C
            wrote on last edited by
            #5

            @SGaist I'm using macOS High Sierra in both computer. On my developpement Mac, Qt seems to recognize SecureTransport using qDebug() << QSslSocket::sslLibraryVersionString(); and same on the my testing Mac.
            But it seems that the Https request works on first one and not the second one for a specific reason I can't get...
            Okay I will try to have another look on this next days...

            Do you have some advices on debugging steps? Like using qDebug() << QSslSocket::sslLibraryVersionString(), to understand wich part on a request can end with trouble?

            Thanks

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

              You should use a tool like wireshark to compare the network activity between the two.

              Are you connecting to a server which has a custom certificate ?

              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
              • Romain CR Offline
                Romain CR Offline
                Romain C
                wrote on last edited by
                #7

                Yeah ! Good idea ! I will have a look !

                About the certificate, it was bought on namecheap (domain name, certificate and hosting). I mean is not something homemade generate !

                Thanks a lot again! =)
                Have a great day

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

                  @Romain-C said in Proper deployment of Qt app (requiring SSL) on MacOS:

                  About the certificate, it was bought on namecheap (domain name, certificate and hosting). I mean is not something homemade generate !

                  Did you try to access your server from the other machine directly just to see if you get an error ?

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

                  Romain CR 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    @Romain-C said in Proper deployment of Qt app (requiring SSL) on MacOS:

                    About the certificate, it was bought on namecheap (domain name, certificate and hosting). I mean is not something homemade generate !

                    Did you try to access your server from the other machine directly just to see if you get an error ?

                    Romain CR Offline
                    Romain CR Offline
                    Romain C
                    wrote on last edited by
                    #9

                    @SGaist What do you mean by a direct access? If you mean using a web browser, it work great!

                    I wanted to see using wireshark if can see anything but as I'm using Https, data are encoded... =/

                    I also move to Qt 6.1.2 to see if anything was related to 5.12, but no changes in the behaviour.

                    However, in case of I missed something, I'm doing following instructions :
                    // Does SSL is supported
                    if(!QSslSocket::supportsSsl())
                    return;

                    QString uniqueId = settings.value(keyValue(UniqueIdentifier), UNIQUE_IDENTIFIER_VALUE).toString();
                    if(uniqueId.isEmpty())
                        return;
                    
                    // Construct request
                    QNetworkRequest request(QUrl("https://[website]"));
                    request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
                    
                    // Construct data
                    QByteArray data;
                    data.append(QString("id="+uniqueId).toUtf8());
                    
                    // Send request
                    QNetworkReply *netReply = anonymousRequests->post(request, data);
                    
                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      I do not see any error handling here, did you just not post them ?

                      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
                      • Romain CR Offline
                        Romain CR Offline
                        Romain C
                        wrote on last edited by
                        #11

                        Hi again,
                        I don't know what you mean by error handling, I check the netReply object answer.
                        On OsX, I just get an empty answer and no error seems to happen.

                        artwawA 1 Reply Last reply
                        0
                        • Romain CR Romain C

                          Hi again,
                          I don't know what you mean by error handling, I check the netReply object answer.
                          On OsX, I just get an empty answer and no error seems to happen.

                          artwawA Offline
                          artwawA Offline
                          artwaw
                          wrote on last edited by
                          #12

                          @Romain-C it is really odd - however I didn't do much work on High Sierra (it is very outdated). On Catalina and BigSur SSL support works out-of-the-box though.
                          Are you able to examine server side logs by any chance? This could help you to check if any connection is being made...

                          With regards to errors you should examine if QNetworkManager::SslErrors() signal is being emitted (simply connect to it) (I assume anonymousRequests is of type QNAM)

                          For more information please re-read.

                          Kind Regards,
                          Artur

                          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