Bug 265315 - Handle Channel.Type.ServerTLSConnection
Summary: Handle Channel.Type.ServerTLSConnection
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: auth-handler (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: 0.6-next
Assignee: David Edmundson
URL:
Keywords:
: 282215 294369 294371 (view as bug list)
Depends on:
Blocks: 294369 294371
  Show dependency treegraph
 
Reported: 2011-02-03 18:04 UTC by Dominik Schmidt
Modified: 2013-03-05 20:42 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Schmidt 2011-02-03 18:04:49 UTC
Version:           unspecified (using Devel) 
OS:                Linux

Handle Channel.Type.ServerTLSConnection

Reproducible: Didn't try


Actual Results:  
If the certificate of the server is not valid, i see a gtk window popping up.

Expected Results:  
If the certificate of the server is not valid, i see a nice kde window popping up.
Comment 1 David Edmundson 2012-02-06 14:11:57 UTC
We need this soon. Any volunteers for this?
Comment 2 David Edmundson 2012-02-06 14:21:30 UTC
*** Bug 282215 has been marked as a duplicate of this bug. ***
Comment 3 Martin Klapetek 2012-02-07 09:40:21 UTC
If you can talk me through it, I can probably get it done.
Comment 4 Daniele E. Domenichelli 2012-02-07 17:25:30 UTC
I tried some time ago to get the TLS stuff working, but the problem at the time was that the auth handler couldn't receive any ofT.Authentication.TLSCertificate object path, so I gave up at that time, but I don't know if this was fixed upstream or not

I agree that this is should be in 0.4, and since Martin already volunteered, I'll just leave all the fun to him ;)

@mkc182 I can try to help as well, but the best person to ask about this is probably andrunko...
Comment 5 David Edmundson 2012-05-17 10:46:09 UTC
@DrDanz I fixed the bug you had.

I know what to do now, just haven't had time.

Assigning to me, deferring to 0.5
Comment 6 Daniele E. Domenichelli 2012-10-28 02:54:56 UTC
Git commit 036d71f4f241a1b0e07c74a8f4a18e370957bcfe by Daniele E. Domenichelli.
Committed on 28/10/2012 at 03:48.
Pushed by ddomenichelli into branch 'master'.

Merge branch 'tls-handler'

This adds a very basic handling of ServerTLSConnection channels
(Still not enabled, you need to enable the TLS handler from main)


http://commits.kde.org/telepathy-auth-handler/036d71f4f241a1b0e07c74a8f4a18e370957bcfe
Comment 7 Daniele E. Domenichelli 2012-10-28 11:15:38 UTC
The "hard" part is done, now we just need a nice dialog, so I'm marking this as a Junior Job
Comment 8 David Edmundson 2012-10-28 11:21:59 UTC
No it is not.

You've done the easy code bit, which I'd got up to (and lost)
The hard part is checking the QSSL Certificate is legit against the KDE verified root certificates.

(and no QSslCerticiate::isValid() does not do it)
Comment 9 Daniele E. Domenichelli 2012-11-02 15:06:16 UTC
*** Bug 294369 has been marked as a duplicate of this bug. ***
Comment 10 Daniele E. Domenichelli 2012-11-02 15:07:32 UTC
*** Bug 294371 has been marked as a duplicate of this bug. ***
Comment 11 Daniel Vrátil 2012-11-11 10:41:27 UTC
I did a little research on this and there is problem: the entire SSL API in KDE is not public, which means that we can't access the KDE certificate manager, certificates rules etc. from the auth-handler.
Comment 12 Martin Klapetek 2012-11-11 10:56:19 UTC
David try making it public, but he didn't succeed afair - see http://lists.kde.org/?l=kde-core-devel&m=133366816318843&w=2 for details
Comment 13 David Edmundson 2012-11-12 01:39:39 UTC
Ok, I feel I should give an update on where we are:

We have a list of QSslCertificates in a chain, we can get the hostname of the server we're trying to connect to from dbus too.

We can get the list of valid CACertificates using http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKSslCertificateManager.html   caCertificates.

What I can't find, is the code to check a certificate is valid for a given hostname, and the cert signing it is valid.. up until the root certificate. What I can't find is the code to do this. This is the part that needs researching and is currently blocking.

/Finally/ if it fails show a dialog to a user. There's some nice code in Rekonq for showing a dialog which takes a certicate and a list of KSSlErrors's indicating what failed. In the event of the user cancelling the dialog we need to turn the KSSlErrors into Tp error codes - which is all pretty trivial.
Comment 14 Daniel Vrátil 2012-11-12 09:27:07 UTC
(In reply to comment #13)
> Ok, I feel I should give an update on where we are:
> 
> We have a list of QSslCertificates in a chain, we can get the hostname of
> the server we're trying to connect to from dbus too.
KSSLD? Nope. It takes/returns KSslCertificateRule objects which are not part of public API.

> We can get the list of valid CACertificates using
> http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/
> classKSslCertificateManager.html   caCertificates.
KSslCertificateManager is not public API either (it is exported, but headers are not installed) - it's mentioned in the ML thread Martin posted above that we could ship our own headers, but that can cause lots of troubles.

> What I can't find, is the code to check a certificate is valid for a given
> hostname, and the cert signing it is valid.. up until the root certificate.
> What I can't find is the code to do this. This is the part that needs
> researching and is currently blocking.
> 
> /Finally/ if it fails show a dialog to a user. There's some nice code in
> Rekonq for showing a dialog which takes a certicate and a list of
> KSSlErrors's indicating what failed. In the event of the user cancelling the
> dialog we need to turn the KSSlErrors into Tp error codes - which is all
> pretty trivial.
Comment 15 Martin Klapetek 2013-01-07 22:48:07 UTC
Rekonq had to solve this same issue (certificates checking), I suggest we look what they did/ask for their help.
Comment 16 David Edmundson 2013-01-08 14:52:49 UTC
Won't help, that uses KIO for HTTP - SSL checking is inbuilt.
Comment 17 Daniel Vrátil 2013-02-06 12:24:50 UTC
Git commit 8a2ab704e6e19c6a06c753a1ed75efd7a29161c0 by Dan Vrátil.
Committed on 06/02/2013 at 13:23.
Pushed by dvratil into branch 'master'.

Merge branch 'tls-handler'

REVIEW: 108791

M  +10   -9    CMakeLists.txt

http://commits.kde.org/telepathy-auth-handler/8a2ab704e6e19c6a06c753a1ed75efd7a29161c0
Comment 18 Dennis Schridde 2013-02-06 15:26:02 UTC
(In reply to comment #17)
Thanks a lot!