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

200 Commits

Author SHA1 Message Date
Graham Leggett
394e5594d6 Introduce a per connection "peer_ip" and a per request "client_ip" to
distinguish between the raw IP address of the connection and the effective
IP address of the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
2011-11-25 19:42:04 +00:00
Graham Leggett
4ee7eea4cf Introduce a per request version of the remote IP address, which can be
optionally modified by a module when the effective IP of the client
is not the same as the real IP of the client (such as a load balancer).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204968 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 13:10:39 +00:00
Joe Orton
de5161b3d9 * modules/ssl/ssl_private.h, modules/ssl/ssl_engine_kernel.c
(ssl_callback_tlsext_tickets): Use unsigned char * to fix gcc
  -Wpointer-sign warnings.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200482 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 19:17:52 +00:00
Paul Querna
a195310515 Remove unneeded memcpy.
Spotted by: Rüdiger Plüm


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200374 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 15:19:15 +00:00
Paul Querna
8b2e0e56c2 Add support for RFC 5077 TLS Session tickets. This adds two new directives:
* SSLTicketKeyFile: To store the private information for the encryption of the ticket.
* SSLTicketKeyDefault To set the default, otherwise the first listed token is used.  This enables key rotation across servers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200040 13f79535-47bb-0310-9956-ffa450edef68
2011-11-09 23:37:37 +00:00
Kaspar Brand
1d7e1125f0 fix indentation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1178694 13f79535-47bb-0310-9956-ffa450edef68
2011-10-04 06:02:42 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Daniel Ruggeri
47cf15b852 Modify SSLProxyMachineCertificateChainFile to use X509 instead of X509_INFO and use openssl to construct the chain
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1170833 13f79535-47bb-0310-9956-ffa450edef68
2011-09-14 20:16:02 +00:00
Kaspar Brand
6231d5a0a7 ssl_callback_proxy_cert(): take advantage of ssl_log_cxerror()
when logging proxy client cert information


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1170567 13f79535-47bb-0310-9956-ffa450edef68
2011-09-14 12:25:31 +00:00
Kaspar Brand
2c24630059 Revamp CRL checking for client and remote servers:
- completely delegate CRL processing to OpenSSL
- introduce a new [Proxy]CARevocationCheck directive
- drop ssl_callback_SSLVerify_CRL from ssl_engine_kernel.c
- remove X509_STORE from modssl_ctx_t
- drop CRL store helper functions from ssl_util_ssl.c
- avoid sending "certificate_expired" SSL alerts to peers
  when the nextUpdate field of a CRL is in the past


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1165056 13f79535-47bb-0310-9956-ffa450edef68
2011-09-04 15:57:03 +00:00
Ruediger Pluem
e63cd2cc79 * Don't SEGFAULT if SSLProxyMachineCertificateChainFile is not set. Just skip the additional lookups in this case.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1162103 13f79535-47bb-0310-9956-ffa450edef68
2011-08-26 13:07:49 +00:00
Daniel Ruggeri
e5df36d18a Add SSLProxyMachineCertificateChainFile directive and documentation for bug 50812
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1160863 13f79535-47bb-0310-9956-ffa450edef68
2011-08-23 19:35:07 +00:00
Kaspar Brand
2453c22a1a Enforce OpenSSL 0.9.7 as a minimum requirement in configure, and
remove #ifdef'ed code which was relevant for earlier versions only.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154688 13f79535-47bb-0310-9956-ffa450edef68
2011-08-07 10:36:57 +00:00
Kaspar Brand
7bd59fd67a Remove the ssl_toolkit_compat layer, which is no longer needed
after support for non-OpenSSL toolkits has been dropped.

Replace macros by their value proper where feasible, and keep
those definitions in ssl_private.h which depend on specific
OpenSSL versions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154687 13f79535-47bb-0310-9956-ffa450edef68
2011-08-07 10:34:31 +00:00
Kaspar Brand
1eb818742f Drop support for the RSA BSAFE SSL-C toolkit from configure,
and remove #ifdef'ed code from mod_ssl and ab where applicable.

Consensus for dropping support for SSL/TLS toolkits other
than OpenSSL was reached on dev@httpd in June 2010 (message
with ID <20100602162310.GA11156@redhat.com> and follow-ups).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154683 13f79535-47bb-0310-9956-ffa450edef68
2011-08-07 10:29:09 +00:00
Stefan Fritsch
a71d0d72cb Avoid unnecessary renegotiations with SSLVerifyDepth 0.
PR: 48215
Submitted by: Kaspar Brand <asfbugz velox ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1137394 13f79535-47bb-0310-9956-ffa450edef68
2011-06-19 18:03:55 +00:00
Stefan Fritsch
48345b21d0 Avoid some memory allocations by using apr_table_setn where the string arguments
are allocated from the request pool and not modified later on.

Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 51358


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1135084 13f79535-47bb-0310-9956-ffa450edef68
2011-06-13 11:04:29 +00:00
Stefan Fritsch
d1638d249f Remove unused variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1090645 13f79535-47bb-0310-9956-ffa450edef68
2011-04-09 18:26:16 +00:00
Joe Orton
7075b21843 * modules/ssl/ssl_engine_kernel.c (ssl_hook_ReadReq): Compare SNI
hostname against Host header case-insensitively.

PR: 49491
Submitted by: Mayank Agrawal <magrawal.08 gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082189 13f79535-47bb-0310-9956-ffa450edef68
2011-03-16 16:32:04 +00:00
Jeff Trawick
4598f1a7d4 fix some grammar mistakes, mostly in comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1080821 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 00:35:39 +00:00
Stephen Henson
8ac6f8e754 Stop warning, init should be an int.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1040373 13f79535-47bb-0310-9956-ffa450edef68
2010-11-30 00:58:07 +00:00
Guenter Knauf
fe04f0b11f Removed unused var.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1040304 13f79535-47bb-0310-9956-ffa450edef68
2010-11-29 21:21:16 +00:00
Stefan Fritsch
35cdba6976 Replace ap_expr with a parser derived from mod_ssl's parser. Make mod_ssl use
the new parser. Rework ap_expr's public interface and provide hooks for modules
to add variables and functions.

The Netware and Windows build files still need to be adjusted


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032073 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06 14:31:16 +00:00
Daniel Earl Poirier
6b803976f2 Fix a number of typos and misspellings. Reported by Ville Skytta.
PR48496.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1029134 13f79535-47bb-0310-9956-ffa450edef68
2010-10-30 17:56:13 +00:00
Stefan Fritsch
db980ab45e mod_ssl: Log certificate information if client cert verification
fails.

PR: 50094
Submitted by: Lassi Tuura <lat cern ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023226 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 09:51:44 +00:00
Stefan Fritsch
8afd97db5f Add authz providers for use with mod_authz_core and its RequireAny/RequireAll
containers:

'ssl' (equivalent to SSLRequireSSL)
'ssl-verify-client' (for use with 'SSLVerifyClient optional')
'ssl-require' (expressions with same syntax as SSLRequire)

We may decide to axe 'ssl-require' again in favor of the generic 'expr'
provider, depending on the development of the ap_expr parser.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002837 13f79535-47bb-0310-9956-ffa450edef68
2010-09-29 20:32:23 +00:00
Stefan Fritsch
f9ba292bfa Make the ssl expression parser thread-safe. It now requires bison instead of
yacc.

Also change the make file magic so that the real source file name is
embedded in the debug info.

The generated files have been created with flex 2.5.35/bison 2.4.1. The two
'no previous prototype' warnings are supposed to be fixed with the next flex
version.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002824 13f79535-47bb-0310-9956-ffa450edef68
2010-09-29 19:42:03 +00:00
Stefan Fritsch
0d11ddb595 - Introduce ap_log_cserror to allow mod_ssl to associate log messages to
different servers than c->base_server.
- Adjust the scope of some mod_ssl trace logging from server to conn.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@954611 13f79535-47bb-0310-9956-ffa450edef68
2010-06-14 19:59:05 +00:00
Stefan Fritsch
01b9f2e551 - Be less verbose at levels INFO and DEBUG in mod_proxy* and mod_ssl
- Add some trace logging to core and http


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951900 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:07:12 +00:00
Stefan Fritsch
af4c0f4923 Use new loglevel accessor macros to simplify code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951896 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:01:29 +00:00
Stefan Fritsch
7d6bd86673 Introduce SSLLOG_MARK for use with ssl_log_ssl_error(). This will allow to
redefine APLOG_MARK later.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951194 13f79535-47bb-0310-9956-ffa450edef68
2010-06-03 22:57:00 +00:00
Joe Orton
55b6450ecb * modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Dump the SSL
error stack if reneg fails; this will give a big hint for failures
  due to secure reneg.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@916733 13f79535-47bb-0310-9956-ffa450edef68
2010-02-26 16:05:11 +00:00
William A. Rowe Jr
dcac7e0552 Catch up ssl to socache store expiry change, and clarify what the code is doing
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@907918 13f79535-47bb-0310-9956-ffa450edef68
2010-02-09 03:44:04 +00:00
Joe Orton
41d7f374af * modules/ssl/ssl_engine_kernel.c (ssl_hook_Fixup): Only set the
"ssl-secure-reneg" note if the server supports secure negotiation,
  so that a '0' value is unambiguous.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906491 13f79535-47bb-0310-9956-ffa450edef68
2010-02-04 14:28:15 +00:00
Joe Orton
08e1e0110b * modules/ssl/ssl_engine_kernel.c (ssl_hook_Fixup): Set
an "ssl-secure-reneg" note indicating whether the client
  supports the secure renegotiation TLS extension.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906485 13f79535-47bb-0310-9956-ffa450edef68
2010-02-04 14:10:55 +00:00
Joe Orton
ade83fa285 * modules/ssl/ssl_engine_vars.c (ssl_var_lookup_ssl): Add
SSL_SECURE_RENEG variable to indicate support for secure reneg.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Fixup_vars): Export
  SSL_SECURE_RENEG in the default set of variable.s


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906057 13f79535-47bb-0310-9956-ffa450edef68
2010-02-03 14:11:19 +00:00
Joe Orton
f1e767fd68 New releases of OpenSSL will only allow secure renegotiation by
default.  Add an "SSLInsecureRenegotiation" directive to enable
renegotiation against unpatched clients, to ease transition:

* modules/ssl/ssl_private.h (struct SSLSrvConfigRec): Add
  insecure_reneg field.

* modules/ssl/ssl_engine_config.c (ssl_config_server_new,
  ssl_config_server_merge): Handle the insecure_reneg flag.
  (ssl_cmd_SSLInsecureRenegotiation): New function.

* modules/ssl/ssl_engine_init.c (ssl_init_ctx_protocol): Set the
  SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION option if insecure_reneg is
  enabled.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Log level of
  support for secure reneg.

* modules/ssl/mod_ssl.c: Add the directive definition.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906039 13f79535-47bb-0310-9956-ffa450edef68
2010-02-03 13:38:09 +00:00
Stefan Fritsch
3560f2e015 Turn static function get_server_name_for_url() into public function
ap_get_server_name_for_url() and use it where appropriate. This fixes
mod_rewrite generating invalid URLs for redirects to IPv6 literal addresses.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@900022 13f79535-47bb-0310-9956-ffa450edef68
2010-01-16 20:32:09 +00:00
Joe Orton
c9897ccf0c Further mitigation for the TLS renegotation attack, CVE-2009-3555:
* modules/ssl/ssl_engine_kernel.c (has_buffered_data): New function.
  (ssl_hook_Access): Forcibly disable keepalive for the connection if
  there is any buffered data readable from the input filter stack.

* modules/ssl/ssl_engine_io.c (ssl_io_filter_input): Ensure that the
  BIO uses blocking operations when invoked outside direct control of
  the httpd filter stack.

Thanks to Hartmut Keil <Hartmut.Keil adnovum.ch> for proposing this
technique.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@891282 13f79535-47bb-0310-9956-ffa450edef68
2009-12-16 15:59:49 +00:00
Joe Orton
a256895c80 * modules/ssl/ssl_engine_kernel.c (ssl_callback_Info): Cast away the
constness of SSL * before calling SSL_get_state, to fix warning with
  older OpenSSLs.

Reported by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@881222 13f79535-47bb-0310-9956-ffa450edef68
2009-11-17 09:54:56 +00:00
Sander Temme
b90aee19b9 enable support for ECC keys and ECDH ciphers. Tested against
OpenSSL 1.0.0b3.  [Vipul Gupta vipul.gupta sun.com, Sander Temme]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@834378 13f79535-47bb-0310-9956-ffa450edef68
2009-11-10 07:55:13 +00:00
Joe Orton
718a24dd45 * modules/ssl/ssl_engine_kernel.c (ssl_callback_Info): Add parentheses
around bitwise-and.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@833593 13f79535-47bb-0310-9956-ffa450edef68
2009-11-06 22:51:42 +00:00
Joe Orton
39d5d9507b SECURITY: Partial fix for CVE-2009-3555:
Reject client-initiated renegotiations; this is sufficient to prevent
the attack for any configuration which does not require renegotiation
due to per-directory/per-location access control configuration.

Configuration with per-directory/per-location access control
requirements (such as "SSLVerifyClient require") are still vulnerable
to CVE-2009-3555 with this patch applied (if using OpenSSL <= 0.9.8k).

* modules/ssl/ssl_private.h (SSLConnRec): Add reneg_state field.
  (ssl_callback_Info): Renamed from ssl_callback_LogTracingState.

* modules/ssl/ssl_engine_init.c (ssl_init_ctx_callbacks): Install
  the (renamed) info callback unconditionally.

* modules/ssl/ssl_engine_io.c (ssl_filter_ctx_t): Add config pointer
  to SSLConnRec.
  (bio_filter_out_write, bio_filter_in_read): Fail with
  APR_ECONNABORTED if the reneg state is set to RENEG_ABORT.

* modules/ssl/ssl_engine_kernel.c (log_tracing_state): Factored out
  of ssl_callback_LogTracingState.
  (ssl_callback_Info): New function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@833582 13f79535-47bb-0310-9956-ffa450edef68
2009-11-06 22:33:19 +00:00
Ruediger Pluem
b35eb008ea * Fix a regression from r724717 by reintroducing SSL_CLIENT_S_DN,
SSL_CLIENT_I_DN, SSL_SERVER_S_DN, SSL_SERVER_I_DN back to the environment
  variables to be set by mod_ssl.

Submitted by: Peter Sylvester <peter.sylvester edelweb.fr>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@820401 13f79535-47bb-0310-9956-ffa450edef68
2009-09-30 19:19:10 +00:00
Sander Temme
274263a214 Expose whether a request was served over an Initial or Resumed SSL session to the environment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@779005 13f79535-47bb-0310-9956-ffa450edef68
2009-05-27 05:41:07 +00:00
Ruediger Pluem
80ccfe3613 * Add SSLStrictSNIVHostCheck to allow / disallow non SNI clients to connect to
name based virtual hosts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@768596 13f79535-47bb-0310-9956-ffa450edef68
2009-04-25 20:15:49 +00:00
Ruediger Pluem
06f79508fb * r->connection->aborted signals that the client aborted the connection, but
in this case *we* decide to close the connection so use
  r->connection->keepalive = AP_CONN_CLOSE


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@768500 13f79535-47bb-0310-9956-ffa450edef68
2009-04-25 09:25:24 +00:00
Ruediger Pluem
7f3acaed7d * Add partial support for name based virtual hosting for non SNI clients.
Submitted by: Kaspar Brand <httpd-dev.2009 velox.ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@768499 13f79535-47bb-0310-9956-ffa450edef68
2009-04-25 09:16:48 +00:00
Ruediger Pluem
74b86123c9 * Fix comment and optimize retrieval of loglevel.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@761181 13f79535-47bb-0310-9956-ffa450edef68
2009-04-02 06:41:50 +00:00
Ruediger Pluem
ceaa1fee2c * Do not allow name based virtual hosts in the case no hostname was
provided via SNI.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757720 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 10:56:55 +00:00