News for hackers. Stuff that matters.
Re:Nginx doesn't suck at SSL after all by masklinn on Wednesday July 13, 2011 @01:29PM (#2759722)
> All the other servers can trivially enable EDH as well

Unless I'm reading OP wrong, that's not the case for the servers he uses for his tests: Stud can't enable it at all:

> stud doesn't have at all.

and in stunnel you have to compile it in for support, it's not just "not enabled by default", it's not compiled in:

> stunnel has it as a compile time/certificate configurable option.

Re:Nginx doesn't suck at SSL after all by jamwt on Wednesday July 13, 2011 @03:59PM (#2760398)
From stud -h:

    Encryption Methods:
       --tls                    (TLSv1, default)
       --ssl                    (SSLv3)
       -c CIPHER_SUITE          (set allowed ciphers)
Edit: Though, you'd need to set DHE params, as another commenter said below. Stud doesn't do this atm, but I'm open to a patch!
Re:Nginx doesn't suck at SSL after all by tptacek on Wednesday July 13, 2011 @04:02PM (#2760421)
I think 'seiji's right, and OpenSSL won't actually do DHE handshakes unless you give it parameters, which is another 2 lines of code that aren't actually in stud.
Re:Nginx doesn't suck at SSL after all by tptacek on Wednesday July 13, 2011 @01:31PM (#2759735)
nginx is a web server, like Apache. stud is a few hundred lines of trivial proxy code. And would you like to take a bet on how many lines of C code it would take to add support for configurable cipher suite modes in stud? Fair warning: I already know the answer to this (and I don't even know that stud doesn't allow it).
Re:Nginx doesn't suck at SSL after all by burgerbrain on Wednesday July 13, 2011 @01:34PM (#2759756)
Do you happen to have a patch? I might be interested in that :)
Re:Nginx doesn't suck at SSL after all by seiji on Wednesday July 13, 2011 @01:48PM (#2759812)
That's the trick -- you can enable your DHE cipher all day long, but if the code doesn't set up DHparams, it will never work.

Here's a quick (no error checking) way to set up DHparams if they are appended to a cert:

    BIO *bio = BIO_new_file(path_to_a_file_with_dhparams, "r");
    DH *dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
    BIO_free(bio);
    SSL_CTX_set_tmp_dh(ctx, dh);
    DH_free(dh);
Where do the DH parameters come from? You can generate it yourself (1024 bits here):

    openssl dhparam -rand - 1024
For a completely isolated implementation (requiring no user certificate changes), see function ngx_ssl_dhparam in nginx-1.0.4/src/event/ngx_event_openssl.c
Re:Nginx doesn't suck at SSL after all by tptacek on Wednesday July 13, 2011 @01:55PM (#2759841)
Doh! 'seiji wins. I was way too glib about DHE. Sorry.
Re:Nginx doesn't suck at SSL after all by newman314 on Thursday July 14, 2011 @01:07AM (#2761830)
Just a bit of history: I was the one that prodded Igor to add this.

I had been checking things out in nginx and noticed that DH was not implemented. One quick email to Igor and he got it done the same day along with getting this into the next version of nginx. Dude is bad ass.

Now if only someone can convince him or provide a patch to add SPDY support to nginx...

Re:Nginx doesn't suck at SSL after all by nuclear_eclipse on Wednesday July 13, 2011 @03:14PM (#2760199)
So what would you do with the generated DH parameters? Literally just `cat` them to the bottom of the SSL cert? Is there anything else that needs to be done? What happens when DHE-RSA-AES256-SHA is used without having those DH parameters in play?
Re:Nginx doesn't suck at SSL after all by seiji on Wednesday July 13, 2011 @04:05PM (#2760431)
Yup. Just add it to the end of your private key/certificate file (NB: only applies to stunnel when configured for DH or other programs reading DHparams from a key/cert file).

If you try to use only DHE-RSA-AES256-SHA without DH being setup, nothing will connect. If you have DHE-RSA-AES256-SHA as an option with others, it will negotiate a non-DH cipher. (e.g. "DHE-RSA-AES256-SHA:!ADH:SHA" -- you can verify the ordering with `openssl ciphers -v DHE-RSA-AES256-SHA:!ADH:SHA`)

Re:Nginx doesn't suck at SSL after all by tptacek on Wednesday July 13, 2011 @01:39PM (#2759771)
Fair warning: this comment is apparently all kinds of wrong, but I leave it here for posterity.

Put:

  if(getenv("SSL_CIPHER_SUITES"))
    SSL_CTX_set_cipher_list(ctx, getenv("SSL_CIPHER_SUITES"));
anywhere after SSL_CTX_new().

But don't bother doing it with stud, because (as I sort of predicted) stud already does this: stud -c <ciphersuites>.

I don't understand what Matt is saying by "stud doesn't enable DH at all". Does stud build its own OpenSSL? The system OpenSSL will already support DHE.

Re:Nginx doesn't suck at SSL after all by benblack on Wednesday July 13, 2011 @10:41PM (#2761544)
Ask and ye shall receive: https://github.com/bumptech/stud/pull/6

stunnel DH code inserted into stud.