1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-06 09:01:14 +03:00
Commit Graph

286 Commits

Author SHA1 Message Date
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
Stefan Eissing
b9ba839d50 new Protocols directive and core API changes to enable protocol switching on HTTP Upgrade or ALPN, implemented in mod_ssl and mod_h2
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1692486 13f79535-47bb-0310-9956-ffa450edef68
2015-07-24 12:09:44 +00:00
Rich Bowen
85f20cb5d2 s/the the/the/g
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1690120 13f79535-47bb-0310-9956-ffa450edef68
2015-07-09 16:01:56 +00:00
Yann Ylavic
33d6aaf455 http, mod_ssl: Introduce and return the 421 (Misdirected Request) status code
for clients requesting a hostname on a reused connection whose SNI (from the
TLS handshake) does not match.
PR 5802.

This allows HTTP/2 clients to fall back to a new connection as per:
https://tools.ietf.org/html/rfc7540#section-9.1.2

Proposed by: Stefan Eissing <stefan eissing.org>
Reviewed by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1685069 13f79535-47bb-0310-9956-ffa450edef68
2015-06-12 11:33:22 +00:00
Yann Ylavic
10806f5db1 mod_ssl: when SSLVerify is disabled (NONE), don't force a renegotiation if
the SSLVerifyDepth applied with the default/handshaken vhost differs from
the one applicable with the finally selected vhost.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1684171 13f79535-47bb-0310-9956-ffa450edef68
2015-06-08 12:25:22 +00:00
Stefan Sperling
2b3c064412 mod_ssl namespacing: Rename SSL_SESSION_id2sz() to modssl_SSL_SESSION_id2sz().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1677835 13f79535-47bb-0310-9956-ffa450edef68
2015-05-05 14:35:48 +00:00
Stefan Sperling
c3f41f5e13 mod_ssl namespacing: Rename SSL_init_app_data2_idx, SSL_get_app_data2,
and SSL_set_app_data2 from SSL_* to modssl_*. Update references in
README.dsov.* files. Rename static variable SSL_app_data2_idx to just
app_data2_idx since the symbol is internal to ssl_util_ssl.c.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1677143 13f79535-47bb-0310-9956-ffa450edef68
2015-05-01 14:03:04 +00:00
Kaspar Brand
8063d62287 Formatting and wording improvements for ALPN (no code changes)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1676709 13f79535-47bb-0310-9956-ffa450edef68
2015-04-29 10:27:32 +00:00
Kaspar Brand
6dd2a90084 Remove NPN support and focus on ALPN (RFC 7301)
* modules/ssl/mod_ssl.c, modules/ssl/mod_ssl.h: drop
  modssl_register_npn optional function and related declarations.

* modules/ssl/ssl_engine_init.c (ssl_init_ctx_callbacks):
  no longer set NPN advertisement callback.

* modules/ssl/ssl_engine_io.c (ssl_io_filter_input): remove
  NPN handling.

* modules/ssl/ssl_engine_kernel.c (ssl_callback_AdvertiseNextProtos):
  remove callback.

* modules/ssl/ssl_private.h: remove NPN prototypes, set
  HAVE_TLS_ALPN (OpenSSL 1.0.2 and later) with feature-based detection.

Rename SSLAlpnPreference to SSLALPNPreference, and add documentation.

Previous commits related to NPN and ALPN, for reference purposes:

r1332643 - Add support for TLS Next Protocol Negotiation
r1487772 - mod_ssl: Redesign NPN (Next Protocol Negotiation) API
           to avoid use of hooks API and inter-module hard linkage
r1670397 - ALPN support, based on mod_spdy/mod_h2 patch set
r1670434 - More ALPN goodness

(plus some minor tweaks: r1670578, r1670440, r1670578,
 r1670738, r1675459, and r1675549)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1676004 13f79535-47bb-0310-9956-ffa450edef68
2015-04-25 09:46:09 +00:00
Stefan Sperling
4c43036c9e mod_ssl namespacing: Rename ssl_util_ssl.h macros from SSL_foo to MODSSL_foo.
For related discussion, see the dev@ thread starting at:
http://mail-archives.apache.org/mod_mbox/httpd-dev/201504.mbox/%3C20150415163613.GC15209%40fintan.stsp.name%3E


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1674538 13f79535-47bb-0310-9956-ffa450edef68
2015-04-18 16:43:34 +00:00
Jim Jagielski
c33564090d Fix issue w/ deterministic ordering and string comparison of "http/1.1." and "h2"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1670738 13f79535-47bb-0310-9956-ffa450edef68
2015-04-01 17:18:59 +00:00
Ruediger Pluem
cd82565218 * ssl_array_index is only used by code inside the HAVE_TLS_ALPN. So silence warnings if don't have it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1670578 13f79535-47bb-0310-9956-ffa450edef68
2015-04-01 08:34:31 +00:00
Jim Jagielski
abf1f3e23f And the lognos
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1670440 13f79535-47bb-0310-9956-ffa450edef68
2015-03-31 19:23:11 +00:00
Rainer Jung
b2f953aa69 Revert r1670436.
Patch was already applied, Jim was quicker.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1670439 13f79535-47bb-0310-9956-ffa450edef68
2015-03-31 19:20:02 +00:00
Rainer Jung
71cf024446 Followup to r1670397+r1670434: even more ALPN goodness.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1670436 13f79535-47bb-0310-9956-ffa450edef68
2015-03-31 19:15:32 +00:00
Jim Jagielski
7a99991874 More ALPN goodness
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1670434 13f79535-47bb-0310-9956-ffa450edef68
2015-03-31 19:12:08 +00:00
Yann Ylavic
0a431ef862 core, modules: like r1657897 but for core and other modules than mod_proxy.
More uses of ap_map_http_request_error() and AP_FILTER_ERROR so that we never
return an HTTP error status from a handler if some filter generated a response
already.

That is, from a handler, either ap_get_brigade() (an input filter) returned
AP_FILTER_ERROR and we must forward it to ap_die(), or ap_pass_brigade() (an
output filter) failed with any status and we must return AP_FILTER_ERROR in
any case for ap_die() to determine whether a response is needed or not.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1665625 13f79535-47bb-0310-9956-ffa450edef68
2015-03-10 17:25:17 +00:00
Graham Leggett
4dafb2e780 mod_ssl: Add the SSL_CLIENT_CERT_RFC4523_CEA variable, which provides
a combination of certificate serialNumber and issuer as defined by
CertificateExactMatch in RFC4523.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1661258 13f79535-47bb-0310-9956-ffa450edef68
2015-02-21 00:33:34 +00:00
Yann Ylavic
7839a61951 mod_ssl: follow up to r1601919.
Likewise when set from SNI callback.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1650061 13f79535-47bb-0310-9956-ffa450edef68
2015-01-07 14:20:57 +00:00
Kaspar Brand
9660add80a Add support for extracting subjectAltName entries of type
rfc822Name and dNSName into SSL_{CLIENT,SERVER}_SAN_{Email,DNS}_n
variables.

* docs/manual/mod/mod_ssl.xml: add SSL_*_SAN_*_n entries to the
  environment variables table

* modules/ssl/ssl_engine_kernel.c: in ssl_hook_Fixup, add extraction
  of subjectAltName entries for the "StdEnvVars" case

* modules/ssl/ssl_engine_vars.c: add support for retrieving the
  SSL_{CLIENT,SERVER}_SAN_{Email,DNS}_n variables, either with
  individual on-demand lookup (ssl_var_lookup_ssl_cert_san),
  or with full-list extraction to the environment ("StdEnvVars")

* modules/ssl/ssl_private.h: add modssl_var_extract_san_entries prototype

* modules/ssl/ssl_util_ssl.c: implement SSL_X509_getSAN and
  SSL_ASN1_STRING_to_utf8 helper functions, with factoring out common
  code from SSL_X509_getIDs and SSL_X509_NAME_ENTRY_to_string where
  suitable. Limit SSL_X509_getSAN to the two most common subjectAltName
  entry types appearing in user or server certificates (i.e., rfc822Name
  and dNSName), for the time being.

* modules/ssl/ssl_util_ssl.h: add SSL_ASN1_STRING_to_utf8
  and SSL_X509_getSAN prototypes


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1650047 13f79535-47bb-0310-9956-ffa450edef68
2015-01-07 12:24:48 +00:00
Yann Ylavic
d35b8319c0 * mod_ssl: Fix renegotiation failures redirected to an ErrorDocument. PR 57334.
When this occurs, the redirect (internal) request reaches ssl_hook_Access()
and make SSL_do_handshake crash probably because we force the renegotiation
based on an incomplete SSL state.

To avoid this, ssl_hook_Access() now returns FORBIDDEN immediatly if the given
SSL connection is not in a valid (handshaken) state.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1644498 13f79535-47bb-0310-9956-ffa450edef68
2014-12-10 18:06:55 +00:00
Christophe Jaillet
a9c4c3a37d Concat string at compile time when possible.
Doing so, sometimes also give the opportunity to turn a 'ap_fputstrs' into a 'ap_fputs'.
PR 53741

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1626050 13f79535-47bb-0310-9956-ffa450edef68
2014-09-18 19:06:52 +00:00
Jeff Trawick
070d6672c9 Set an error note for requests rejected due to SSLStrictSNIVHostCheck.
This allows custom error documents to include the specific reason
for denying access to the server.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1609936 13f79535-47bb-0310-9956-ffa450edef68
2014-07-12 14:48:04 +00:00