Results 1 to 15 of 15

Thread: QSslSocket: connecting SIGNAL and SLOT

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2012
    Posts
    34
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSslSocket: connecting SIGNAL and SLOT

    Cheers!

    There is a server running. I've tried to use the existing fortuna SSL server example in addition to my own server. And if I use the fortuna client (SSL version) against either one of them, connection succeeds. This implies that the problem is with this client I'm implementing now. My understanding is that certificates are not needed in client side if the server is not requesting them. Anyway I'll have to take a look at the errors you mentioned.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QSslSocket: connecting SIGNAL and SLOT

    Client certificates are rarely required, but I was thinking about the server cert. If the server is offering a self-signed certificate (or one signed by an unrecognised CA) then the client cannot verify the server and the connection will not proceed by default.

  3. #3
    Join Date
    Sep 2012
    Posts
    34
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSslSocket: connecting SIGNAL and SLOT

    Actually server certificate is self-signed one (created by myself), but I just cannot see why the problem is seen only with the client under implementation. Why the fortuna secure client works fine?

    Yesterday I checked the sslErrors() on client side and this was what I found: "The host name did not match any of the valid hosts for this certificate". I have not yet figured out what does that exactly mean in this case. I thought that in this basic scenario on client side it would not check any certificates...

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSslSocket: connecting SIGNAL and SLOT

    Quote Originally Posted by Mobility View Post
    Actually server certificate is self-signed one (created by myself), but I just cannot see why the problem is seen only with the client under implementation. Why the fortuna secure client works fine?
    Because it ignores the error.

    See the docs for QSslSocket::ignoreSslErrors().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Sep 2012
    Posts
    34
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSslSocket: connecting SIGNAL and SLOT

    Thanks guys! I did miss that one line which can be used to ignore the SSL errors. After getting the connection working, I managed (with your help) to get also the client_connection class working and now I'm able to send & receive data as planned from any existing class in my program. Thanks again!

Similar Threads

  1. Connecting custom signal and slot
    By DmitryNik in forum Newbie
    Replies: 4
    Last Post: 12th September 2011, 14:15
  2. Replies: 2
    Last Post: 7th August 2011, 11:50
  3. Connecting signal and slot by name
    By grayfox in forum Qt Programming
    Replies: 1
    Last Post: 22nd July 2011, 09:00
  4. Replies: 3
    Last Post: 17th November 2010, 14:12
  5. Connecting signal to custom slot?
    By dbrmik in forum Qt Tools
    Replies: 2
    Last Post: 30th April 2009, 09:28

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
  •  
Qt is a trademark of The Qt Company.