1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

1245 Commits

Author SHA1 Message Date
Yann Ylavic
a365a65513 mod_ssl: Fix merge problem with SSLProtocol that made SSLProtocol ALL ignored
in virtualhost context (new version of r1653906 reverted by r1653993).

Submitted By: Michael Kaufmann <apache-bugzilla michael-kaufmann.ch>
Committed/modified By: ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1653997 13f79535-47bb-0310-9956-ffa450edef68
2015-01-22 18:37:06 +00:00
Yann Ylavic
4c52577a7f mod_ssl: revert r1653906, will commit an alternative just after.
The issue with r1653906 is that existing configurations like
"SSLProtocol -SSLv3" (where the default is assumed to be ALL)
won't work anymore.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1653993 13f79535-47bb-0310-9956-ffa450edef68
2015-01-22 18:27:46 +00:00
Eric Covener
6d6a8a16f1 Fix merge problem with SSLProtocol that made SSLProtocol ALL ignored
in virtualhost context.

Submitted By: Michael Kaufmann <apache-bugzilla michael-kaufmann.ch>
Commited By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1653906 13f79535-47bb-0310-9956-ffa450edef68
2015-01-22 15:19:39 +00:00
Rainer Jung
bf93fed8a1 Add SSLSessionTickets (on|off).
It controls the use of TLS session tickets
(RFC 5077). Default is unchanged (on).

Using session tickets without restarting
the web server with an appropriate frequency
(e.g. daily) compromises perfect forward
secrecy.

As long as we do not have a nice key management
there should be a way to deactivate session
tickets.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1650310 13f79535-47bb-0310-9956-ffa450edef68
2015-01-08 15:34:10 +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
Ruediger Pluem
ab1523a721 * Return NULL instead of an empty string as ssl_var_lookup_ssl does by default. Thanks for the pointer Christophe
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1645670 13f79535-47bb-0310-9956-ffa450edef68
2014-12-15 14:57:52 +00:00
Jeff Trawick
c5062591f9 Fix extraction of an SCT list from a stapled OCSP response.
The hard-coded 2 byte offset to get to the list (in lieu of
the proper logic) didn't survive the addition of the SCT
from an additional log.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1645546 13f79535-47bb-0310-9956-ffa450edef68
2014-12-15 01:37:40 +00:00
Jeff Trawick
8e416f19be ssl_io_filter_handshake(): When a post-handshake check fails,
return an error code understood by ssl_io_filter_error().

That function needs to perform error handling, and a valid
apr_status_t needs to be returned up.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1645529 13f79535-47bb-0310-9956-ffa450edef68
2014-12-14 21:48:25 +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
Jeff Trawick
2c334bcba5 follow up to r1641077:
one bug was traded for another in r1641077; track the response
length and the cached object length separately to avoid such
confusion


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1641095 13f79535-47bb-0310-9956-ffa450edef68
2014-11-22 17:54:08 +00:00
Jeff Trawick
70b441b9df mod_ssl: Fix recognition of OCSP stapling responses that are encoded
improperly or too large.

The one byte "ok" flag stored with the response was accounted for in
the wrong condition.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1641077 13f79535-47bb-0310-9956-ffa450edef68
2014-11-22 14:51:01 +00:00
Jan Kaluža
4f2fb6d486 * mod_ssl: call ERR_free_strings() with OpenSSL >= 0.9.8e. Fixes memory leak
in mod_ssl on graceful restart. PR 53435.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1638772 13f79535-47bb-0310-9956-ffa450edef68
2014-11-12 12:27:09 +00:00
Christophe Jaillet
08c20e7f58 tab vs space
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1638412 13f79535-47bb-0310-9956-ffa450edef68
2014-11-11 21:16:11 +00:00
Christophe Jaillet
10ab77117b tab vs space
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1633531 13f79535-47bb-0310-9956-ffa450edef68
2014-10-22 05:25:23 +00:00
Christophe Jaillet
00e4c4fbc9 tab vs space
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1633530 13f79535-47bb-0310-9956-ffa450edef68
2014-10-22 05:25:02 +00:00
Jan Kaluža
d8fd328cfb mod_ssl: Fix SSL_CLIENT_VERIFY value when "SSLVerifyClient optional_no_ca" and
SSLSessionCache are used and SSL session is resumed. SSL_CLIENT_VERIFY value
has been set to SUCCESS on resumption even when originally it was set to
GENEROUS. PR 53193.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1633085 13f79535-47bb-0310-9956-ffa450edef68
2014-10-20 09:18:22 +00:00
Christophe Jaillet
a3ca028f70 Style ('{' on same line as function definition)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1631021 13f79535-47bb-0310-9956-ffa450edef68
2014-10-11 05:47:02 +00:00
Ruediger Pluem
e3cc8a66f0 * Check if we are having an SSL connection before looking up SSL related
variables during expression evaluation to avoid a crash. If not return
  an empty string.

PR: 57070


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1630947 13f79535-47bb-0310-9956-ffa450edef68
2014-10-10 17:54:33 +00:00
Jeff Trawick
c478a4da6f mod_ssl_ct: Work with current Certificate Transparency tools
(e.g., as of certificate-transparency commit 
3f03188fe89974d45345fddee64a8227bd2ec26a)

The interface to the "ct" tool now requires the log's URL and
public key, resulting in a bit of refactoring in the module.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1630624 13f79535-47bb-0310-9956-ffa450edef68
2014-10-10 00:16:05 +00:00
Jeff Trawick
0d4cb3f363 log the command-line before invoking the log client
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629785 13f79535-47bb-0310-9956-ffa450edef68
2014-10-06 23:19:55 +00:00
Yann Ylavic
31342ca73d Follow up to r1629372 and r1629485: ensure compatibily with OpenSSL < 1.0 (sk_OPENSSL_STRING_[num|value|pop] macros).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629519 13f79535-47bb-0310-9956-ffa450edef68
2014-10-05 18:36:02 +00:00
Yann Ylavic
25cb3bad84 Follow up to r1629372: ensure compatibily with OpenSSL < 1.0 (sk_OPENSSL_STRING_value).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629485 13f79535-47bb-0310-9956-ffa450edef68
2014-10-05 11:41:52 +00:00
Kaspar Brand
7cc90787fb Move OCSP stapling information from a per-certificate store
(ex_data attached to an X509 *) to a per-server hash which is
allocated from the pconf pool. Fixes PR 54357, PR 56919 and
a leak with the certinfo_free cleanup function (missing
OCSP_CERTID_free).

* modules/ssl/ssl_util_stapling.c: drop certinfo_free, and add
  ssl_stapling_certid_free (used with apr_pool_cleanup_register).
  Switch to a stapling_certinfo hash which is keyed by the SHA-1
  digest of the certificate's DER encoding, rework ssl_stapling_init_cert
  to only store info once per certificate (allocated from the pconf
  to the extent possible) and extend the logging.

* modules/ssl/ssl_private.h: adjust prototype for
  ssl_stapling_init_cert, replace ssl_stapling_ex_init with
  ssl_stapling_certinfo_hash_init

* modules/ssl/ssl_engine_init.c: adjust ssl_stapling_* calls

Based on initial work by Alex Bligh <alex alex.org.uk>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629372 13f79535-47bb-0310-9956-ffa450edef68
2014-10-04 10:58:49 +00:00
Jeff Trawick
8cf87ccbf7 Adjust Certificate Transparency support (mod_ssl_ct) to build with/require OpenSSL 1.0.2 Beta 3.
Update notes on missing OpenSSL documentation.

Submitted by: ben (the primary changes), trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1628833 13f79535-47bb-0310-9956-ffa450edef68
2014-10-01 20:54:04 +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
Joe Orton
abb1385ef5 Omitted from r1620926 in error.
Add API to support TLS channel bindings with mod_ssl.

* modules/ssl/mod_ssl.h: Define ssl_get_tls_cb.

* modules/ssl/ssl_engine_vars.c (ssl_get_tls_cb): New function.

Submitted by: Simo Sorce <simo redhat.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1620927 13f79535-47bb-0310-9956-ffa450edef68
2014-08-27 16:12:08 +00:00
Joe Orton
b86c933b08 Add API to support TLS channel bindings with mod_ssl.
* modules/ssl/mod_ssl.h: Define ssl_get_tls_cb.

* modules/ssl/ssl_engine_vars.c (ssl_get_tls_cb): New function.

Submitted by: Simo Sorce <simo redhat.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1620926 13f79535-47bb-0310-9956-ffa450edef68
2014-08-27 16:11:17 +00:00
Jeff Trawick
dca1da20e3 Add message numbers to mod_ssl_ct messages with severity > debug.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612122 13f79535-47bb-0310-9956-ffa450edef68
2014-07-20 17:08:20 +00:00
Christophe Jaillet
56d0c25725 Add missing APLOGNO.
Refactor some lines to keep APLOGNO on the same line as ap_log_error, when applicable.
Split lines longer than 80.
Improve alignment.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612068 13f79535-47bb-0310-9956-ffa450edef68
2014-07-20 09:32:58 +00:00
Christophe Jaillet
089d2e0373 Do not use deprecated define.
No change in generated code because MODULE_MAGIC_NUMBER is defined as:
   #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611871 13f79535-47bb-0310-9956-ffa450edef68
2014-07-19 09:46:20 +00:00
Guenter Knauf
87377937a7 Fixed mod_ssl NetWare build.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611012 13f79535-47bb-0310-9956-ffa450edef68
2014-07-16 13:50:44 +00:00
Rainer Jung
5f7ec543ec Extend the scope of SSLSessionCacheTimeout to sessions
resumed by TLS session resumption (RFC 5077).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610311 13f79535-47bb-0310-9956-ffa450edef68
2014-07-13 22:30:44 +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
Jeff Trawick
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
Jeff Trawick
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
Jeff Trawick
2d53bf18ca APR_THREAD_FUNC decorator needed for 32-bit builds on Windows
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1606337 13f79535-47bb-0310-9956-ffa450edef68
2014-06-28 12:55:08 +00:00
Joe Orton
eb681e6e60 * modules/ssl/ssl_engine_init.c: Make DH handling a bit more generic,
and adjust selection logic to prefer use of larger not smaller keys.
  (init_dh_params, free_dh_params, modssl_get_dh_params): Use array of
  structs to store and initialize DH parameters up to 8192-bit.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1605827 13f79535-47bb-0310-9956-ffa450edef68
2014-06-26 15:49:49 +00:00
Joe Orton
33ef4d63bc * modules/ssl/ssl_engine_init.c (make_dh_params): Remove redundant
temporary variable; no functional change.
  (free_dh_params): Add comment.

Submitted by: rpluem, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1603915 13f79535-47bb-0310-9956-ffa450edef68
2014-06-19 15:09:15 +00:00
Yann Ylavic
c14ecfa1dd mod_ssl: dump SSL IO/state for the write side of the connection(s), like reads.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601919 13f79535-47bb-0310-9956-ffa450edef68
2014-06-11 14:42:32 +00:00
Yann Ylavic
ec3eebef53 mod_ssl: SSL_smart_shutdown(): follow up to r1601184.
Use SSL_get_wbio() to comply with OPENSSL_NO_SSL_INTERN.
Stop SSL shutdown loop when flush fails.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601274 13f79535-47bb-0310-9956-ffa450edef68
2014-06-08 23:54:58 +00:00
Yann Ylavic
6502fec22a mod_ssl: Ensure that the SSL close notify alert is flushed to the client.
PR54998.

Submitted By: Tim Kosse <tim.kosse filezilla-project.org>, ylavic
Committed By: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601184 13f79535-47bb-0310-9956-ffa450edef68
2014-06-07 22:53:52 +00:00
Joe Orton
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
Ruediger Pluem
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
Christophe Jaillet
2d01df12ea Fix duplicate APLOGNO
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1596108 13f79535-47bb-0310-9956-ffa450edef68
2014-05-20 04:02:49 +00:00
Jeff Trawick
048df00d71 Follow-up to r1588987:
Fix doc and code confusion about the trust/distrust flag; 1 is
distrust, 0 or NULL/- is trust.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1595861 13f79535-47bb-0310-9956-ffa450edef68
2014-05-19 12:24:06 +00:00
Yann Ylavic
54f9353df0 mod_ssl: follow up to r1583191.
Use type BOOL for modssl_ctx_t's field ocsp_use_request_nonce.
Suggested by: kbrand.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591401 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 17:15:07 +00:00
Jeff Trawick
a5d79394e3 Follow-up to r1587607:
Export new mod_ssl APIs when using traditional Windows build mechanism


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1589699 13f79535-47bb-0310-9956-ffa450edef68
2014-04-24 12:51:48 +00:00
Jeff Trawick
4921c237ba allow operation without any logs configured or without the
log client tool configured

this supports configurations where SCTs are managed by the admin or
by some other infrastructure


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1589398 13f79535-47bb-0310-9956-ffa450edef68
2014-04-23 12:45:45 +00:00
Jeff Trawick
d4515e5187 ensure that the post-config hook runs after that of mod_ssl
(mod_ssl_ct looks for stuff that should have been found
while mod_ssl ran)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1589389 13f79535-47bb-0310-9956-ffa450edef68
2014-04-23 12:38:03 +00:00