Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved how to download a file from ssl

    General and Desktop
    ssl
    4
    16
    3616
    Loading More Posts
    • 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.
    • A
      ARASHz4 last edited by

      hi
      i using QNetworkAccessManager & QNetworkReply i can download non-ssl but i can't download a file With ssl like this file : https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png

      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @ARASHz4 last edited by

        @ARASHz4
        connect to QNetworkAccessManager's sslErrors() signal and check why it is called.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        A 1 Reply Last reply Reply Quote 0
        • S
          stephane78 last edited by

          @ARASHz4, Hi, link your project with openssl libraries libssl and libcrypto and it will be ok.....

          raven-worx 1 Reply Last reply Reply Quote 0
          • raven-worx
            raven-worx Moderators @stephane78 last edited by

            @stephane78
            They are loaded when needed, so absolutely no need to link against them and introduce another dependency.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply Reply Quote 0
            • A
              ARASHz4 @raven-worx last edited by ARASHz4

              @raven-worx i connect sslErrors :

              connect(reply, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT (sslErrors(const QList<QSslError>&)));
              

              but don't call sslErrors
              when i start a download in my app, in application output return this :

              qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_client_method
              qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_client_method
              qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_server_method
              qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_server_method
              qt.network.ssl: QSslSocket: cannot resolve SSL_select_next_proto
              qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
              qt.network.ssl: QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
              
              the_ 1 Reply Last reply Reply Quote 0
              • the_
                the_ @ARASHz4 last edited by

                @ARASHz4
                Do you have the SSL libraries available (globally installed and available in %PATH% or copied into the folder that contains your exe)?

                -- No support in PM --

                A 1 Reply Last reply Reply Quote 1
                • A
                  ARASHz4 @the_ last edited by

                  @the_ No

                  1 Reply Last reply Reply Quote 0
                  • A
                    ARASHz4 last edited by

                    in install OpenSSL in my system after i installed this in application output don't return this:

                    qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_client_method
                    qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_client_method
                    qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_server_method
                    qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_server_method
                    qt.network.ssl: QSslSocket: cannot resolve SSL_select_next_proto
                    qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
                    qt.network.ssl: QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
                    

                    but Still i cant download a file from ssl

                    the_ 1 Reply Last reply Reply Quote 0
                    • the_
                      the_ @ARASHz4 last edited by

                      @ARASHz4

                      Do you get any errors when you try to download the file?

                      -- No support in PM --

                      A 1 Reply Last reply Reply Quote 0
                      • A
                        ARASHz4 @the_ last edited by

                        @the_ yes, the error is:

                        Host https not found
                        
                        the_ 1 Reply Last reply Reply Quote 0
                        • the_
                          the_ @ARASHz4 last edited by

                          @ARASHz4

                          Maybe you can post some code how you try to download the file?
                          Our USB crytall ball is currently not working ;)

                          -- No support in PM --

                          A 1 Reply Last reply Reply Quote 0
                          • A
                            ARASHz4 @the_ last edited by

                            @the_ this is my project :
                            https://github.com/ARASHz4/Advanced_Downloader

                            the_ 1 Reply Last reply Reply Quote 0
                            • the_
                              the_ @ARASHz4 last edited by

                              @ARASHz4

                              Well thanks, but I think you know better where you call which method/function whith which parameters.

                              Its hard to read through a whole project without any documentation

                              -- No support in PM --

                              A 1 Reply Last reply Reply Quote 1
                              • A
                                ARASHz4 @the_ last edited by

                                @the_ class for download is downloader.cpp & downloader.h

                                the_ 1 Reply Last reply Reply Quote 0
                                • the_
                                  the_ @ARASHz4 last edited by

                                  @ARASHz4

                                  Digging through your files i found this

                                  QUrl Url;
                                  
                                          if(!DownloadListUrl[currentDownload].contains("http://"))
                                          {
                                              Url = "http://" + DownloadListUrl[currentDownload];
                                          }
                                          else
                                          {
                                              Url = DownloadListUrl[currentDownload];
                                          }
                                  
                                          FileDownload = new Downloader(Url, this);
                                  

                                  This is impossible to work. If you have an URL like "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Fibonacci_spiral.svg.png/120px-Fibonacci_spiral.svg.png"
                                  this piece of code does not find http:// in the URL string and will prepend it so it will be "http://https://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Fibonacci_spiral.svg.png/120px-Fibonacci_spiral.svg.png" afterwards.

                                  -- No support in PM --

                                  A 1 Reply Last reply Reply Quote 1
                                  • A
                                    ARASHz4 @the_ last edited by

                                    @the_ I fixed this bug.
                                    Thank you.

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post