PeterMosmans / openssl

'Extra featured' OpenSSL with ChaCha20 and Poly1305 support
https://onwebsecurity.com/pages/openssl.html
Other
92 stars 18 forks source link

Proxy Option #49

Closed drwetter closed 7 years ago

drwetter commented 7 years ago

Hi Peter,

maybe it's time to backport the proxy option from 1.1. The current apps/s_client.c does a CONNECT HTTP/0.9. Newer openssl versions (1.1) seems to use 1.0:

OLD (from apps/s_client.c)

  if (http_proxy_str) {
            int foundit=0;
            BIO *fbio = BIO_new(BIO_f_buffer());
            BIO_push(fbio, sbio);
            BIO_printf(fbio,"CONNECT %s\r\n\r\n", connect_str);
            (void)BIO_flush(fbio);
            /* wait for multi-line response to end CONNECT response */
            do

New:

           BIO_push(fbio, sbio);
            BIO_printf(fbio, "CONNECT %s HTTP/1.0\r\n\r\n", connectstr);
            (void)BIO_flush(fbio);
            /*
             * The first line is the HTTP response.  According to RFC 7230,
             * it's formated exactly like this:
             *
             * HTTP/d.d ddd Reason text\r\n
             */

In one environment I have an outbound squid proxy which doesn't seem to accept 0.9. See also https://github.com/drwetter/testssl.sh/issues/741 and https://github.com/drwetter/testssl.sh/issues/739 .

It probably boils down to just add HTTP/1.0... Would you like a PR or would you do it yourself?

Cheers!

Dirk

drwetter commented 7 years ago

merged, see e90b60086e4ed9649cb3aab08f2b4c6529e7a95a