Results 1 to 10 of 10

Thread: QSslSocket - problem with connecting to the server

  1. #1
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSslSocket - problem with connecting to the server

    I've written such piece of code:
    Qt Code:
    1. sock.connectToHostEncrypted(host,port);
    2. if(!sock.waitForEncrypted(TIMEOUT))
    3. {
    4. report(sock.errorString());
    5. return false;
    6. }
    To copy to clipboard, switch view to plain text mode 

    And when this part of the program is executed, I'm receiving such debug messages;
    QSslSocket: cannot call unresolved function SSLv3_client_method
    QSslSocket: cannot call unresolved function SSL_CTX_new
    QSslSocket: cannot call unresolved function SSL_library_init
    QSslSocket: cannot call unresolved function ERR_get_error
    QSslSocket: cannot call unresolved function ERR_error_string
    What's wrong? Is the program missing any DDL files? Does it have something to do with OpenSSL?

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSslSocket - problem with connecting to the server

    Very likely so.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  3. #3
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSslSocket - problem with connecting to the server

    What's very likely? I think that installing OpenSSL will solve the problem for me but what to do when I want to distribute the program? On Linux it wouldn't be a problem, because OpenSSL is very popular there, but it's an application designed for Windows - is there a way to add OpenSSL to the my program's installation package? What ideas do you have?

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSslSocket - problem with connecting to the server

    Either include the OpenSSL with your program or provide a link to it, depending on it's license requirements.

  5. #5
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSslSocket - problem with connecting to the server

    But it seems I can't stop these errors from appearing even on my computer - they're still present after installing OpenSSL for Win32 from this site: http://www.slproweb.com/products/Win32OpenSSL.html
    Maybe I should copy some OpenSSL-realted DLLs to the executable's catalogue? I'm really confused - I don't understand it at all, and Qt's SSL documentation doesn't say much about OpenSSL, either.

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSslSocket - problem with connecting to the server

    Is OpenSSL in your path?

  7. #7
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSslSocket - problem with connecting to the server

    What do you mean saying "in your path"? What path? I've installed it in C:/OpenSSL while my project is In E:/.../

    EDIT:
    Ok, I've managed to make it work, but that's only on my device. Now I'm thinking which files should I include to the installation package to not have to run separate installation.
    Last edited by kremuwa; 18th July 2010 at 15:28.

  8. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSslSocket - problem with connecting to the server

    Windows+R -> cmd -> echo %PATH%

    Is the OpenSSL libs in that path?

  9. #9
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSslSocket - problem with connecting to the server

    No, it isn't but it's working although this fact.
    Now I'm thinking which files should I include to the installation package to not have to run separate installation.

  10. #10
    Join Date
    Aug 2010
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo
    Wiki edits
    9

    Default Re: QSslSocket - problem with connecting to the server

    This method works for me (Qt 4.6 in Nokia Qt SDK)
    http://codeblog.vurdalakov.net/2009/...nnot-call.html
    You need to install OpenSSL Win32 or Win64 binaries.

    1. Open Win32 OpenSSL Installation Project page.
    2. Download the latest "light" Win32 or Win64 installation package, for example "Win32 OpenSSL v0.9.8l Light".
    3. Install it to any location. Ignore "Microsoft Visual C++ 2008 Redistributables" warning (click OK) and select copying OpenSSL DLLs to "The OpenSSL binaries (\bin) directory".
    4. Copy libeay32.dll and ssleay32.dll from the \bin folder to the same place where your QtNetwork4.dll or QtNetworkd4.dll is located.

    (In Nokia Qt SDK - there are 2 folders which are missing those file)

Similar Threads

  1. Replies: 3
    Last Post: 29th November 2009, 21:24
  2. QSslSocket based server never finishes handshake (Solved)
    By December in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2009, 15:15
  3. QSslSocket server
    By tpf80 in forum Qt Programming
    Replies: 3
    Last Post: 7th May 2009, 05:10
  4. Problem in connecting to PostgreSQL
    By c_srikanth1984 in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2009, 08:18
  5. QSslSocket problem
    By The Storm in forum Qt Programming
    Replies: 5
    Last Post: 23rd March 2008, 13:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.