After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 719381 - On The Web calendar fails with 'SSL handshake failed'
On The Web calendar fails with 'SSL handshake failed'
Status: RESOLVED NOTGNOME
Product: evolution-data-server
Classification: Platform
Component: Calendar
3.10.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-calendar-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2013-11-26 20:39 UTC by Milan Crha
Modified: 2013-12-09 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Milan Crha 2013-11-26 20:39:16 UTC
Moving this from a downstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1034810

Description of problem:
When trying to add a web calendar, evolution fails with "Unable to connect to 'CALENDAR-NAME': Cannot open calendar: SSL handshake failed"

Version-Release number of selected component (if applicable): 3.10.2
How reproducible: always

Steps to Reproduce:
1. Add calendar "On the Web" with URI "https://basecamp.com/1788133/calendar_feeds/c744724.ics?token=TlpObVZzMTVrQlBBeWg4Y3JiSFpwdz09LS05Z3JCNGNVL25sczJ3QXZNZVlheTN3PT0%3D--35f00ea56760b54c23e5c8397f7191250d4e24e4-715358"

Actual results: an error is shown, a RESET TCP packet on wireshark
Expected results: no error and no events (the calendar is empty)
Comment 1 Milan Crha 2013-11-26 20:40:06 UTC
It's weird, you are supposed to be asked what to do with the certificate, whether you want to ignore the SSL error or reject connection, when the server certificate looks suspicious. Nonetheless, I tried to reproduce this with your URL and I see the same issue, no prompt for a certificate.
Comment 2 Milan Crha 2013-11-26 21:01:06 UTC
After a quick debugging, the SoupMessage has "properly" set its status_code to SOUP_STATUS_SSL_FAILED, but it doesn't contain any information about the failure, aka the soup_message_get_https_status() call on the SoupMessage instance fails, the cert is NULL and flags 0, which is treated as "always reject to connect there", mainly because there is nothing to show to the user.

Dan, can this be some issue in libsoup? I recall there used to be one similar, but I hoped the 2.44.2 may have it already fixed.
Comment 3 Milan Crha 2013-11-26 21:05:36 UTC
I forgot to mention, the soup_session is created with these flags:
	soup_session = soup_session_sync_new ();
	g_object_set (
		soup_session,
		SOUP_SESSION_TIMEOUT, 90,
		SOUP_SESSION_SSL_STRICT, TRUE,
		SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, TRUE,
		NULL);

https://git.gnome.org/browse/evolution-data-server/tree/calendar/backends/http/e-cal-backend-http.c#n174
Comment 4 Dan Winship 2013-12-09 16:55:57 UTC
(In reply to comment #2)
> After a quick debugging, the SoupMessage has "properly" set its status_code to
> SOUP_STATUS_SSL_FAILED, but it doesn't contain any information about the
> failure, aka the soup_message_get_https_status() call on the SoupMessage
> instance fails, the cert is NULL and flags 0, which is treated as "always
> reject to connect there", mainly because there is nothing to show to the user.
> 
> Dan, can this be some issue in libsoup? I recall there used to be one similar,
> but I hoped the 2.44.2 may have it already fixed.

I think the situations that are actual cert rejections should all be fixed, but SOUP_STATUS_SSL_FAILED will also be returned for any other error originating from gnutls. In unstable libsoup you get the text of the error in msg->reason_phrase, though I think that was a post-2.44 improvement. Anyway:

    danw@laptop:examples (master)> ./get 'https://basecamp.com/1788133/calendar_feeds/c744724.ics?token=TlpObVZzMTVrQlBBeWg4Y3JiSFpwdz09LS05Z3JCNGNVL25sczJ3QXZNZVlheTN3PT0%3D--35f00ea56760b54c23e5c8397f7191250d4e24e4-715358'
    /1788133/calendar_feeds/c744724.ics: 6 Error performing TLS handshake: An illegal TLS extension was received. (no handshake status)

"gnutls-cli -d 9 basecamp.com" shows:

    |<3>| EXT[0x2370310]: Parsing extension 'SUPPORTED ECC/10' (4 bytes)
    |<2>| ASSERT: ecc.c:95
    |<2>| ASSERT: gnutls_extensions.c:206
    |<2>| ASSERT: gnutls_handshake.c:1734
    |<2>| ASSERT: gnutls_handshake.c:2154
    |<2>| ASSERT: gnutls_handshake.c:1383
    |<2>| ASSERT: gnutls_handshake.c:2634
    *** Fatal error: An illegal TLS extension was received.

where:

    92    if (session->security_parameters.entity == GNUTLS_CLIENT)
    93      {
    94        /* A client shouldn't receive this extension */
    95        return gnutls_assert_val(GNUTLS_E_RECEIVED_ILLEGAL_EXTENSION);
    96      }


So, basically, basecamp.com is sending a TLS extension that is only defined for clients, not servers, and gnutls, being anal like it is, aborts at that point.

File a bug against basecamp I guess?

You can kludge around this by running e-d-s with

    G_TLS_GNUTLS_PRIORITY="NORMAL:%COMPAT:-ECDHE-RSA"

set in the environment, which will keep e-d-s (and any other glib-tls-based code in that environment) from negotiating elliptic-curve encryption, thus bypassing the server bug.