1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-02 18:26:38 +03:00

373 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
fe07b16cc2 Perform SNI checks only on the initial request. In particular,
if these checks detect a problem, the checks shouldn't return an
error again when processing an ErrorDocument redirect for the
original problem.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1609914 13f79535-47bb-0310-9956-ffa450edef68
2014-07-12 13:26:42 +00:00
f61bb82760 The SNI callback already logs a debug message when the vhost
is found or no vhost matches.  Log one when no name is provided
by the client.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1608284 13f79535-47bb-0310-9956-ffa450edef68
2014-07-06 18:58:19 +00:00
d3eac27e32 Create DH parameters from OpenSSL at module init, avoiding (very
minor) race and leaks:

* modules/ssl/ssl_engine_init.c (make_dh_params): Moved/rejigged
  variant of make_get_dh() macro.
  (init_dh_params, free_dh_params): New functions.
  (modssl_get_dh_params): Split out from ssl_callback_TmpDH.
  (ssl_init_Module, ssl_init_ModuleKill): Use new init_/free_.

* modules/ssl/ssl_engine_kernel.c: Moved out DH parameter handling.
  (ssl_callback_TmpDH): Use modssl_get_dh_params.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1598107 13f79535-47bb-0310-9956-ffa450edef68
2014-05-28 19:14:28 +00:00
3adb3b8bf3 * Hand out the same DH structure in ssl_callback_TmpDH set by
SSL_CTX_set_tmp_dh_callback though once generated as we leak
  memory otherwise and freeing the structure up after use would be
  hard to track and in fact is not needed at all as it is safe to
  use the same parameters over and over again security wise (in
  contrast to the keys itself) and code safe as the returned structure
  is duplicated by OpenSSL anyway. Hence no modification happens
  to our copy.

Observed by: rjung
Reviewed by: kbrand


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1597349 13f79535-47bb-0310-9956-ffa450edef68
2014-05-24 20:28:56 +00:00
eced8a0d15 ssl_callback_TmpDH: for OpenSSL 1.0.2 and later, set the current cert to the
one actually used for the connection before calling SSL_get_privatekey(ssl)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588851 13f79535-47bb-0310-9956-ffa450edef68
2014-04-21 06:39:24 +00:00
cbba0dbc00 Bring SNI behavior into better conformance with RFC 6066:
- no longer send a warning-level unrecognized_name(112) alert
  when no matching vhost is found (PR 56241)

- at startup, only issue warnings about IP/port conflicts and name-based
  SSL vhosts when running with an OpenSSL without TLS extension support
  (almost 5 years after SNI was added to 2.2.x, the
  "[...] only work for clients with TLS server name indication support"
  warning feels obsolete)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1585090 13f79535-47bb-0310-9956-ffa450edef68
2014-04-05 12:57:43 +00:00
d165c70c09 Quick spelling fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1566449 13f79535-47bb-0310-9956-ffa450edef68
2014-02-09 22:04:54 +00:00
d647d32f5f typo in comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1566428 13f79535-47bb-0310-9956-ffa450edef68
2014-02-09 21:24:38 +00:00
66b8feb600 fix a few spelling errors
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1563894 13f79535-47bb-0310-9956-ffa450edef68
2014-02-03 13:50:14 +00:00
924e07c32b Fix config merging of SSLOCSPEnable and SSLOCSPOverrideResponder.
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555631 13f79535-47bb-0310-9956-ffa450edef68
2014-01-05 21:18:28 +00:00
df2bbb7417 * Update comment. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555240 13f79535-47bb-0310-9956-ffa450edef68
2014-01-03 20:07:54 +00:00
72e2b1052a * Do not perform SNI / Host header comparison in case of a forward proxy request as
in case of a forward proxy request the host header can not be used for virtual
  host selection in our webserver.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1553204 13f79535-47bb-0310-9956-ffa450edef68
2013-12-23 20:47:59 +00:00
169f992d89 Improve ephemeral key handling (companion to r1526168):
- allow to configure custom DHE or ECDHE parameters via the
  SSLCertificateFile directive, and adapt its documentation
  accordingly (addresses PR 49559)

- add standardized DH parameters from RFCs 2409 and 3526,
  use them based on the length of the certificate's RSA/DSA key,
  and add a FAQ entry for clients which limit DH support
  to 1024 bits (such as Java 7 and earlier)

- move ssl_dh_GetParamFromFile() from ssl_engine_dh.c to
  ssl_util_ssl.c, and add ssl_ec_GetParamFromFile()

- drop ssl_engine_dh.c from mod_ssl

For the standardized DH parameters, OpenSSL version 0.9.8a
or later is required, which was therefore made a new minimum
requirement in r1527294.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1527295 13f79535-47bb-0310-9956-ffa450edef68
2013-09-29 10:35:46 +00:00