Subject: Re: bug#23027: 25.1.50; Emacs refuses to talk to eternal-september because they now use an MD5 certificate, apparently

From: Lars Magne Ingebrigtsen <[email-masked]>
Date: Sun, 24 Apr 2016 16:03:40 +0200

Lars Magne Ingebrigtsen <[email-masked]> writes:

> Here's an easy test case:
>
> (open-network-stream
>  "nntpd" (get-buffer-create "*foo*")
>  "news.eternal-september.org" "nntp"
>  :type 'starttls
>  :end-of-command "^\\([2345]\\|[.]\\).*\n"
>  :capability-command "HELP\r\n"
>  :success "^3"
>  :starttls-function
>  (lambda (capabilities)
>    (if (not (string-match "STARTTLS" capabilities))
>        nil
>      "STARTTLS\r\n")))
>
> First of all, I think the error message is lacking.  It should say more
> about what's failing.

I've now fixed this...

> As to the bug -- gnutls by default now refuses to deal with MD5
> certificates.  We could override that, and instead let the network
> security manager notify the user that the connection isn't safe.

This apparently has nothing to do with MD5?  Included below is what
s_client says about the TLS connection.  It's ECDSA...

Hm...  but there is a self signed certificate in the chain.  Uhm...
using GNUTLS_VERIFY_DISABLE_CA_SIGN doesn't help, I still get
GNUTLS_E_UNSUPPORTED_SIGNATURE_ALGORITHM.  Hm...

Is it possible that the gnutls installation is just too old or
something?  Weird.

[larsi@stories /usr/include/gnutls]$ openssl s_client -connect news.eternal-september.org:nntps
CONNECTED(00000003)
depth=1 O = Root CA, OU = http://www.cacert.org, CN = CA Cert Signing Authority, emailAddress = [email-masked]
verify error:num=19:self signed certificate in certificate chain
verify return:0
---
Certificate chain
 0 s:/CN=news.eternal-september.org
   i:/O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/emailAddress=[email-masked]
 1 s:/O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/emailAddress=[email-masked]
   i:/O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/emailAddress=[email-masked]
---
Server certificate
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
subject=/CN=news.eternal-september.org
issuer=/O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/emailAddress=[email-masked]
---
No client certificate CA names sent
---
SSL handshake has read 4358 bytes and written 416 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 4086 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384
    Session-ID: 79FA1DD8A295D1D96475BE1818E88C3C28059A074AA8B743871B48243C203072
    Session-ID-ctx: 
    Master-Key: 156AF5671933E472B5B2E5ACAED0FB40B6F4EE997F9F2DABA13F548E9B64DB4565C4FD9B7D9539AF0D7A77B64E3942F4
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 300 (seconds)
    TLS session ticket:
    0000 - 65 10 86 c0 3b 81 89 d6-b6 63 74 7a c6 9d 9b 3b   e...;....ctz...;
    0010 - a8 38 e2 4a dc 47 96 f6-90 b5 37 6b 33 dc 73 2b   .8.J.G....7k3.s+
    0020 - 9c fb 97 e9 fc de 22 70-b7 da 76 0b 92 f3 94 72   ......"p..v....r
    0030 - 49 c5 ac 15 9f a3 5f 1e-e9 c6 19 b1 ed 16 1d 50   I....._........P
    0040 - 8a 0a 74 70 8e 97 ed 09-04 99 3d 75 cd 4d 46 15   ..tp......=u.MF.
    0050 - 93 b1 31 50 e0 28 bc b3-dd da 46 2c ac 00 47 88   ..1P.(....F,..G.
    0060 - a5 c3 b1 ad e1 86 d8 f3-85 c8 c3 9e c5 cf bb 9d   ................
    0070 - 93 14 8d c6 de c9 ff 7e-f6 45 99 35 cb 83 41 ab   .......~.E.5..A.
    0080 - 97 06 11 85 4a ee 76 a5-f4 1b 11 17 98 dd ec aa   ....J.v.........
    0090 - f2 48 d4 b6 2d 2e 16 a9-53 03 c1 96 96 31 ba ab   .H..-...S....1..

    Start Time: 1461506257
    Timeout   : 300 (sec)
    Verify return code: 19 (self signed certificate in certificate chain)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no