1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-10 02:02:49 +03:00
Commit Graph

308 Commits

Author SHA1 Message Date
Stefan Eissing
352d92c698 On the trunk:
mod_ssl TLSv1.3 support, removed V1_3 cipher suite directives again and added an optional protocol specifier to the SSLCipherSuite and SSLProxyCipherSuite commands.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827992 13f79535-47bb-0310-9956-ffa450edef68
2018-03-29 14:10:12 +00:00
Stefan Eissing
8b305c8397 On the trunk:
mod_ssl: Added configuration directives for TLSv1.3 cipher suites (which
     are separate from previous ones) as SSL(Proxy)CipherSuiteV1_3. A great opportunity
     to find a better name.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827924 13f79535-47bb-0310-9956-ffa450edef68
2018-03-28 15:38:51 +00:00
Christophe Jaillet
e94ac9326f Use 'ap_log_rerror()' instead of 'ap_log_error()' consistently
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827865 13f79535-47bb-0310-9956-ffa450edef68
2018-03-27 20:17:24 +00:00
Christophe Jaillet
e203d68bc4 Use 'ap_request_has_body()' instead of duplicating its implemenation.
The logic in 'ap_request_has_body()' is:
    has_body = (!r->header_only
                && (r->kept_body
                    || apr_table_get(r->headers_in, "Transfer-Encoding")
                    || ( (cls = apr_table_get(r->headers_in, "Content-Length"))
                        && (apr_strtoff(&cl, cls, &estr, 10) == APR_SUCCESS)
                        && (!*estr)
                        && (cl > 0) )
                    )
                );
So the test is slighly different from the original code. (but this looks fine to me)

This also has the advantage to avoid a redundant call to 'apr_table_get()' and to improve readability.

While at it, move the test '!r->expecting_100' a few lines above because it is cheap.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827374 13f79535-47bb-0310-9956-ffa450edef68
2018-03-20 23:05:54 +00:00
Stefan Eissing
1184290ddd Extend SSLOCSPEnable with mode 'leaf' that only checks the leaf of a certificate chain. PR62112 [Ricardo Martin Camarero <rickyepoderi@yahoo.es>]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1826995 13f79535-47bb-0310-9956-ffa450edef68
2018-03-16 15:25:08 +00:00
Joe Orton
0b9b299354 * modules/ssl/ssl_engine_kernel.c (ssl_hook_UserCheck): Check username
does not contain a colon before constructing Authorization header
  for FakeBasicAuth mode. (Also constify 'user' variable.)

PR: 52644


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1815592 13f79535-47bb-0310-9956-ffa450edef68
2017-11-17 17:14:32 +00:00
Joe Orton
b14a732d6f Fix typo in log message.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805163 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 09:50:39 +00:00
Stefan Eissing
a68a39d321 log tags for mod_ssl changes and new mod_md
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1804531 13f79535-47bb-0310-9956-ffa450edef68
2017-08-09 13:59:26 +00:00
Stefan Eissing
e7a858c2bd branch for integrating mod_md into trunk
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/trunk-md@1804087 13f79535-47bb-0310-9956-ffa450edef68
2017-08-04 09:52:04 +00:00
Yann Ylavic
31a4103652 mod_ssl, ab: compatibility with LibreSSL. PR 61184.
LibreSSL defines OPENSSL_VERSION_NUMBER = 2.0, but is not compatible with
all of the latest OpenSSL 1.1 API.

Address this by defining MODSSL_USE_OPENSSL_PRE_1_1_API which is true for
anything but OpenSSL >= 1.1 (for now).

Proposed by: Bernard Spil <brnrd freebsd.org>
Reviewed by: ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1803396 13f79535-47bb-0310-9956-ffa450edef68
2017-07-29 23:05:02 +00:00
Joe Orton
b70d7ae5b5 * modules/ssl/ssl_engine_kernel.c (ssl_callback_SessionTicket): Fail
if RAND_bytes() fails; possible per API, although not in practice
  with the OpenSSL implementation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757147 13f79535-47bb-0310-9956-ffa450edef68
2016-08-22 11:10:58 +00:00
Yann Ylavic
a0cddc57d4 mod_ssl: Fix quick renegotiation (OptRenegotiaton) with no intermediate
in the client certificate chain.  PR 55786.

This is done by handling an empty cert chain as no/NULL chain.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756542 13f79535-47bb-0310-9956-ffa450edef68
2016-08-16 18:24:56 +00:00
Rainer Jung
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
Rainer Jung
a6517fdf5e Silence more "defined but not used" compiler
warnings when building against OpenSSL 0.9.8a.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755881 13f79535-47bb-0310-9956-ffa450edef68
2016-08-10 21:57:14 +00:00
Rainer Jung
83ed3dff9f Silence "defined but not used" compiler warnings
when building against OpenSSL 0.9.8a.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755874 13f79535-47bb-0310-9956-ffa450edef68
2016-08-10 21:34:21 +00:00
Stefan Eissing
22204edc7a modssl: reset client-verify state when renegotiation is aborted
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750779 13f79535-47bb-0310-9956-ffa450edef68
2016-06-30 12:08:42 +00:00
Yann Ylavic
f9ad2754f7 mod_proxy, mod_ssl: Handle SSLProxy* directives in <Proxy> sections,
allowing per backend TLS configuration.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1740928 13f79535-47bb-0310-9956-ffa450edef68
2016-04-26 00:04:57 +00:00
Rainer Jung
e387d3e9c7 Support for OpenSSL 1.1.0:
- X509_STORE_CTX is now opaque.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1740653 13f79535-47bb-0310-9956-ffa450edef68
2016-04-23 13:17:52 +00:00
Yann Ylavic
1a829ed2fa mod_ssl: follow up to r1734561 and r1735337.
We also need to reset the X509_STORE_CTX's error in the callback to quiet
X509_V_ERR_UNABLE_TO_GET_CRL for the leaf certificate (caught by AH02010).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1737265 13f79535-47bb-0310-9956-ffa450edef68
2016-03-31 18:24:06 +00:00
Yann Ylavic
4015277a9a mod_ssl: return non ambiguous value in ssl_callback_SessionTicket() for
encryption mode (we used to return 0, OpenSSL documents returning 1 instead).

Practically this does not change anything since OpenSSL will only check for
>= 0 return value (non error) for encryption mode (the other possible return
values are only relevant for decryption mode).

However the OpenSSL documentation for SSL_CTX_set_tlsext_ticket_key_cb()
states:
"
The return value of the cb function is used by OpenSSL to determine what
further processing will occur. The following return values have meaning:

2
    This indicates that the ctx and hctx have been set and the session can
    continue on those parameters. Additionally it indicates that the session
    ticket is in a renewal period and should be replaced. The OpenSSL library
    will call cb again with an enc argument of 1 to set the new ticket (see
    RFC5077 3.3 paragraph 2).

1
    This indicates that the ctx and hctx have been set and the session can
    continue on those parameters.

0
    This indicates that it was not possible to set/retrieve a session ticket
    and the SSL/TLS session will continue by by negotiating a set of
    cryptographic parameters or using the alternate SSL/TLS resumption
    mechanism, session ids.
    If called with enc equal to 0 the library will call the cb again to get a
    new set of parameters.

less than 0
    This indicates an error.
"

So 0 is not appropriate in our code, 1 is what we really want (and it won't
break if OpenSSL later changes its checks on the callback return value).

Reported/Proposed by: oknet on github, pull request #18.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1736186 13f79535-47bb-0310-9956-ffa450edef68
2016-03-22 13:09:17 +00:00
Rainer Jung
dcf2165a63 Support for OpenSSL 1.1.0:
- The callback function passed to
  SSL_CTX_sess_set_get_cb() now needs the
  session id argument to be const.
  So constify the session id.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735883 13f79535-47bb-0310-9956-ffa450edef68
2016-03-20 14:23:06 +00:00
Rainer Jung
f048635f6f Support for OpenSSL 1.1.0:
- SRP_VBASE_get_by_user() is deprecated now,
  one should use SRP_VBASE_get1_by_user()
  instead. The new function returns a pointer
  owned by the callee. It must be freed after
  use.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735877 13f79535-47bb-0310-9956-ffa450edef68
2016-03-20 13:21:46 +00:00
Yann Ylavic
5bc7c3ca2d mod_ssl: follow up to r1734561.
Simplify CRL check mode and flags handling/merging by using a single mask (int).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735337 13f79535-47bb-0310-9956-ffa450edef68
2016-03-16 22:54:27 +00:00
Yann Ylavic
45d8a4c9c0 mod_ssl: follow up to r1734561.
Use the right crl_check_flags in ssl_callback_SSLVerify(), can be either
a client or proxy connection here.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735159 13f79535-47bb-0310-9956-ffa450edef68
2016-03-15 19:13:36 +00:00
Yann Ylavic
bafafe600b mod_ssl: Add no_crl_for_cert_ok flag to SSLCARevocationCheck directive
to opt-in previous behaviour (2.2) with CRLs verification when checking
certificate(s) with no corresponding CRL.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734561 13f79535-47bb-0310-9956-ffa450edef68
2016-03-11 13:51:17 +00:00
Rainer Jung
8eb3099574 Support for OpenSSL 1.1.0
- Simplify code by using new 1.1.0 variant
  also for older OpenSSL. Also tested with
  1.0.2f and 0.9.8zh. No ssl test suite
  failures.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1731423 13f79535-47bb-0310-9956-ffa450edef68
2016-02-20 16:46:38 +00:00
Rainer Jung
dc221e7adc Support for OpenSSL 1.1.0:
- 1.1.0-pre3 was relesed
  - remove pre2 comments which no longer apply
  - one more struct has been made opaque, use
    accessor function instead


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1731012 13f79535-47bb-0310-9956-ffa450edef68
2016-02-18 07:44:16 +00:00
Rainer Jung
d7639a5ad0 Support OpenSSL 1.1.0.
- use common code for OpenSSL pre-1.1.0 and
  1.1.0 where possible.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730422 13f79535-47bb-0310-9956-ffa450edef68
2016-02-14 22:40:07 +00:00
Rainer Jung
e2017967f9 Support for OpenSSL 1.1.0:
- use SSL_peek instead of looping with
  has_buffered_data().

This fixes t/security/CVE-2009-3555.t where
has_buffered_data() doesn't help, because it
finds the buffered data and doesn't call
SSL_read(), so the reneg handshake isn't
triggered. SSL_peek() for 0 bytes seems to
reliably trigger the reneg in every case.

No more polling/sleeping. The code for the
OpenSSL 1.1.0 case is now again very close to
the pre 1.1.0 case.

Still need to run the full test suite with a
clean build.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730316 13f79535-47bb-0310-9956-ffa450edef68
2016-02-14 11:24:39 +00:00
Rainer Jung
434a3b9717 Support for OpenSSL 1.1.0:
- Fix typo in loop end condition

This code will be removed next. Thex fix is
for the case we want to roll teh code back
to this state.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730314 13f79535-47bb-0310-9956-ffa450edef68
2016-02-14 11:16:18 +00:00
Rainer Jung
35c192e868 Support OpenSSL 1.1.0:
- Fix renegotiation for the client side
  of a proxy connection.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730146 13f79535-47bb-0310-9956-ffa450edef68
2016-02-13 01:52:31 +00:00
Rainer Jung
9f4bd17eda Support for OpenSSL 1.1.0:
- fix copy&paste typos
  (wrong version number in "#if").


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729998 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 11:29:36 +00:00
Rainer Jung
9d0cc0b345 Support for OpenSSL 1.1.0:
- fix rejecting client initiated renegotiations


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729968 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 10:03:48 +00:00
Rainer Jung
4741048ff3 Support for OpenSSL 1.1.0:
- further improvements for renegotiation
No more test suite failures for reneg,
but still using not so nice polling.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729927 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 00:44:22 +00:00
Stefan Eissing
4019a9f3d2 tune from rocky horror picture show: Doing the handshake...again
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729581 13f79535-47bb-0310-9956-ffa450edef68
2016-02-10 11:04:03 +00:00
Rainer Jung
5d55a0052d OpenSSl 1.1.0 support
- improve renegotiation loop.
  Should now also work in case only the
  cipher changes.
  Should now also work in case the handshake
  ends with an error.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729498 13f79535-47bb-0310-9956-ffa450edef68
2016-02-09 23:18:20 +00:00
Rainer Jung
a1d33eade8 Support for OpenSSL 1.1.0:
- partial support for renegotiations.
  - Not a good design, need to poll until
    renegotitation has finished.
  - Loop criterion not right, if no client certs
    will be send.
  - Also doesn't work for EC or DH ciphers.
    Unclear how to fix with current 1.1.0
    API.
  - Details see
    http://marc.info/?t=145493359200002&r=1&w=2


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729341 13f79535-47bb-0310-9956-ffa450edef68
2016-02-09 09:55:18 +00:00
Rainer Jung
8bc4871c57 Support for OpenSSL 1.1.0:
- mod_ssl
Look out for "XXX: OpenSSL 1.1.0:" for a few
open problems.

Not tested with test suite yet.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728909 13f79535-47bb-0310-9956-ffa450edef68
2016-02-07 01:20:37 +00:00
Stefan Eissing
909aa9a87b scoreboard addition of protocol, new ap_udpte_child_status methods
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726009 13f79535-47bb-0310-9956-ffa450edef68
2016-01-21 16:36:33 +00:00
William A. Rowe Jr
73e623b049 Fix missing Upgrade headers on OPTION * requests, PR58688
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1717816 13f79535-47bb-0310-9956-ffa450edef68
2015-12-03 17:33:06 +00:00
Stefan Eissing
ddf4c280a1 mod_ssl: check request-server for TLS settings compatible to handshake server, allow request if equal, renegotiation checks: remember last used cipher_suite for optimizations, deny any regnegotiation in presence of master connection
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1709995 13f79535-47bb-0310-9956-ffa450edef68
2015-10-22 11:36:22 +00:00
Stefan Eissing
ebb34c0b07 mod_ssl: performing protocol switch directly after ALPN selection, mod_http2: connection hook inits network filters to force TLS handshake, reads input only if H2Direct explicitly enabled, changes H2Direct default to off even for cleartext connections
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1708107 13f79535-47bb-0310-9956-ffa450edef68
2015-10-12 13:13:45 +00:00
Joe Orton
f58c0c5a8e * modules/ssl/ssl_engine_kernel.c: Constify the ssl_hook_Fixup_vars array itself.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1707512 13f79535-47bb-0310-9956-ffa450edef68
2015-10-08 12:17:41 +00:00
Yann Ylavic
719890b9bd Sync http2 stuff with 2.4.x.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705819 13f79535-47bb-0310-9956-ffa450edef68
2015-09-29 09:12:59 +00:00
Yann Ylavic
357b2a9973 mod_ssl: update the current handshake server once a full regenegotation
succeeds, it is the new reference for further renegotiation or SNI check.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1703871 13f79535-47bb-0310-9956-ffa450edef68
2015-09-18 14:31:48 +00:00
Stefan Eissing
0ae671360d patch from yann that fixes MISDIRECTED_REQUEST handling for setups with ServerAlias/subjectAltNames
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1703822 13f79535-47bb-0310-9956-ffa450edef68
2015-09-18 12:42:53 +00:00
Stefan Eissing
ea390af213 httpd compiles warning free on gcc and every new warning will be treated as an error, standard c-89 is enforced
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1702948 13f79535-47bb-0310-9956-ffa450edef68
2015-09-14 13:29:35 +00:00
Yann Ylavic
cad3cbd7f6 mod_ssl: fix compiler warning (bad cast).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1701145 13f79535-47bb-0310-9956-ffa450edef68
2015-09-03 22:59:18 +00:00
Stefan Eissing
379f9d4d33 changed Protocols default to http/1.1 only, updated documentation, changed ap_select_protocol() to return NULL when no protocol could be agreed upon
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1701005 13f79535-47bb-0310-9956-ffa450edef68
2015-09-03 12:45:26 +00:00
Stefan Eissing
cf6c7246d5 first stab at a better SNI vs. request name matching, by accounting for serveralias and wildcards
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1698330 13f79535-47bb-0310-9956-ffa450edef68
2015-08-28 13:00:52 +00:00