Results 1 to 20 of 25

Thread: How to set x509 on a QSqlDatabase Connection?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2011
    Posts
    36
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    14

    Default Re: How to set x509 on a QSqlDatabase Connection?

    Indeed, the referencing doesn't matter. But I did prove the following:
    1. The path to the certificates is correct.
    2. The way they are used in mysql_ssl_set() is correct.
    3. That the program is actually using an SSL connection:
    a. because MySQL Server accepted the connection, while it was configured to ONLY accept user "test", if he could supply a valid x509.
    b. because the SHOW STATUS LIKE 'Ssl_cipher' replies with the cipher used, and it ONLY does that when a SSL connection is established.
    c. becuase WireShark reports SSL trafic on port 3306
    4. That somehow setting the QSqlDriver or QMySQlDriver handle with my code doesn't work via mysql_ssl_set().

    Whom should I contact for an explanation? Where can I find documentation about the underlying structures? Maybe anyone reading this has a similar problem and found a solution? Or is it a Qt shortcoming in arguments that can be specified for QSqlDriver?

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

    Default Re: How to set x509 on a QSqlDatabase Connection?

    Quote Originally Posted by m3rlin View Post
    1. The path to the certificates is correct.
    Not necessarily but that's a minor problem.
    4. That somehow setting the QSqlDriver or QMySQlDriver handle with my code doesn't work via mysql_ssl_set().
    There is no such handle. There is the MYSQL structure which is a MySql handle which is exactly the same what you are using in your test program.

    Whom should I contact for an explanation?
    What kind of explanation?

    Where can I find documentation about the underlying structures?
    Qt's SQL drivers are documented in Qt's docs.

    Or is it a Qt shortcoming in arguments that can be specified for QSqlDriver?
    Yes, and you need to work around that by calling mysql_ssl_set at the right moment (like directly after calling addDatabase())
    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.


Similar Threads

  1. Replies: 0
    Last Post: 18th September 2011, 08:58
  2. QSqlDatabase Connection Close on Destruction
    By Sanuden in forum Qt Programming
    Replies: 1
    Last Post: 1st September 2011, 15:32
  3. QSqlDatabase connection timeout?
    By joseprl89 in forum Qt Programming
    Replies: 6
    Last Post: 27th March 2011, 01:43
  4. QSqlDatabase PSQL connection options
    By leknarf in forum Qt Programming
    Replies: 0
    Last Post: 17th March 2010, 16:06
  5. Replies: 3
    Last Post: 22nd June 2006, 16:27

Tags for this Thread

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.