Results 1 to 3 of 3

Thread: QSslSocket and cipher problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSslSocket and cipher problem

    Hello!

    I have a problem selecting a supported cipher suite and establish a SSL encrypted connection. So I created a exmaple do demonstrate the problem and the result confused me again.

    The example created a server socket on port 9876 that should support all ciphers that are available on the system (result of static function QSslSocket::supportedCiphers()).
    It uses "/tmp/mycert.key" and "/tmp/mycert.crt" for the key / private certificate.
    You can create a sample one with:
    Qt Code:
    1. openssl req -x509 -nodes -days 365 -subj '/C=DE/ST=Bavaria/L=Sample-City/CN=sampledomain' -newkey rsa:1024 -keyout /tmp/mycert.key -out /tmp/mycert.crt
    To copy to clipboard, switch view to plain text mode 

    The client and server SSL socket sets VerfiyNone for peer verification and using the SSLv3 protocol.

    For each available cipher a socket is created, that supports only that one cipher, and an encryption connection to the server socket (that supports "all" ciphers") is initiated.

    You will get a lot of debug output on stderr (qDebug, ...).

    The debug output shows me:
    - 49 ciphers are available
    - 10 encrypted connections could be established
    - 4 handshake errors occurred on client side
    - 35 handshake errors occurred on server side

    On command line you can give the execution mode. Use argument 's' if you want to start the server component or 'c' if you want to start the client component.

    So first start the server mode:
    Qt Code:
    1. ./QtSslTest s 2>&1 | tee /tmp/server.log
    To copy to clipboard, switch view to plain text mode 

    and while the server is running, start the client mode:
    Qt Code:
    1. ./QtSslTest c 2>&1 | tee /tmp/client.log
    To copy to clipboard, switch view to plain text mode 

    I hope, someone could explain me, why "supported" ciphers could not be used to establish an encrypted connection.

    Source code is attached.
    Attached Files Attached Files
    Last edited by maggu2810; 29th July 2011 at 21:43.

Similar Threads

  1. QSslSocket example
    By Ratheendrans in forum Qt Programming
    Replies: 3
    Last Post: 6th July 2011, 20:51
  2. QSslSocket vs QTcpSocket problem
    By camol in forum Qt Programming
    Replies: 56
    Last Post: 24th March 2011, 14:32
  3. QSslSocket - problem with connecting to the server
    By kremuwa in forum Qt Programming
    Replies: 9
    Last Post: 26th August 2010, 14:40
  4. NEED HELP!!! about qsslsocket
    By asnoka in forum Installation and Deployment
    Replies: 2
    Last Post: 12th May 2008, 15:12
  5. QSslSocket problem
    By The Storm in forum Qt Programming
    Replies: 5
    Last Post: 23rd March 2008, 12: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
  •  
Qt is a trademark of The Qt Company.