Commit Graph

909 Commits

Author SHA1 Message Date
04fd4abf90 Fix a lot of doxygen warnings. Thanks to Brad Hards for the patch.
I added a few more fixes, and there are still more that might
need a doxygen expert.

PR: 48061
Submitted by: Brad Hards
Reviewed by: poirier


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@830527 13f79535-47bb-0310-9956-ffa450edef68
2009-10-28 13:25:49 +00:00
9596adcdb1 fixed indents.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@830175 13f79535-47bb-0310-9956-ffa450edef68
2009-10-27 13:31:30 +00:00
2db0e1a114 converted tabs, removed trailing spaces.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@830045 13f79535-47bb-0310-9956-ffa450edef68
2009-10-27 01:35:22 +00:00
b2cb650f61 Add support for OCSP "stapling":
* modules/ssl/ssl_util_stapling.c: New file.

* modules/ssl/config.m4, modules/ssl/mod_ssl.dsp: Build it.

* modules/ssl/ssl_toolkit_compat.h: Define HAVE_OCSP_STAPLING if
  OpenSSL is of suitable version (>= 0.9.8g) and capability (TLS
  extension support enabled).

* modules/ssl/mod_ssl.c: Add config directives.

* modules/ssl/ssl_private.h: Add prototypes for new functions.
  (SSLModConfigRec): Add fields for stapling socache instance and
  associated mutex.
  (modssl_ctx_t): Add config fields for stapling.

* modules/ssl/ssl_engine_init.c (ssl_init_Module, ssl_init_Child):
  Call the stapling initialization functions.

* modules/ssl/ssl_engine_config.c: Add config hooks.

* modules/ssl/ssl_scache.c: Create, initialize and destroy the socache
  instance for OCSP responses.

Submitted by: Dr Stephen Henson <shenson oss-institute.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@829619 13f79535-47bb-0310-9956-ffa450edef68
2009-10-25 17:21:10 +00:00
f32c6eddba replaced all backticks with single quotes in output strings.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821621 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 21:33:46 +00:00
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
158ed01bff fixed wrong 3rd parameter passed to apr_brigade_split_line().
Problem showed up with Sun Studio; mentioned by Jie Gao on the list.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@819373 13f79535-47bb-0310-9956-ffa450edef68
2009-09-27 18:53:33 +00:00
7bdc3a4ceb fixed compatibility to Openssl < 0.9.7g.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@819245 13f79535-47bb-0310-9956-ffa450edef68
2009-09-27 02:54:07 +00:00
c2a484bbb1 * modules/ssl/ssl_util_ocsp.c, modules/ssl/ssl_engine_ocsp.c:
Move comment on I/O timeout to appropriate place, thanks to
  Steve Henson.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@815741 13f79535-47bb-0310-9956-ffa450edef68
2009-09-16 12:47:33 +00:00
229ca83b8f * modules/ssl/ssl_util_ocsp.c (send_request,
modssl_dispatch_ocsp_request): Take timeout as argument, as pass through.
  
* modules/ssl/ssl_engine_ocsp.c (verify_ocsp_status): Pass server timeout
  to modssl_dispatch_ocsp_request.

Submitted by: Dr Stephen Henson <shenson oss-institute.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@815719 13f79535-47bb-0310-9956-ffa450edef68
2009-09-16 10:56:31 +00:00
df83bf1ef7 Make sure the NULL terminator of the array is consistent with the other
elements in the array.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@813165 13f79535-47bb-0310-9956-ffa450edef68
2009-09-09 23:12:15 +00:00
b35a6b58f1 mod_ssl: The error message when SSLCertificateFile is missing should at
least give the name or position of the problematic virtual host definition.
[Stefan Fritsch sf sfritsch.de]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@813105 13f79535-47bb-0310-9956-ffa450edef68
2009-09-09 20:35:05 +00:00
cea543cf79 removed another obsolete cast. Mentioned by Peter Sylvester.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@798989 13f79535-47bb-0310-9956-ffa450edef68
2009-07-29 17:42:49 +00:00
3175d7782f removed obsolete cast. Mentioned by Peter Sylvester.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@798274 13f79535-47bb-0310-9956-ffa450edef68
2009-07-27 20:22:59 +00:00
efcb56a2f4 Fix hung SSL handshake if a particularly long CA list is configured:
* modules/ssl/ssl_engine_io.c (bio_filter_in_read): Flush pending
  output unconditionally since OpenSSL is known to not flush correctly
  at all times, and it should be cheap even in cases where it is
  unnecessary.

PR: 46952


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@788715 13f79535-47bb-0310-9956-ffa450edef68
2009-06-26 14:22:20 +00:00
781f39a68a * modules/ssl/ssl_engine_io.c (bio_filter_out_ctrl): Switch
implementation of BIO_CTRL_PENDING and BIO_CTRL_WPENDING, to return
  zero and pending-bytes-to-write respectively.

PR: 46952
Submitted by: David Smith <David.Smith cern.ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@787722 13f79535-47bb-0310-9956-ffa450edef68
2009-06-23 15:42:02 +00:00
abb49b2202 * modules/ssl/ssl_engine_vars.c (ssl_var_lookup_ssl_cert_dn_rec): Map
the _UID variable to NID_userId, where defined by OpenSSL.

PR: 45107
Submitted by: Michael Ströder <michael stroeder.com>,
     Peter Sylvester <peter.sylvester edelweb.fr>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@787683 13f79535-47bb-0310-9956-ffa450edef68
2009-06-23 14:10:06 +00:00
b87a8928d4 * module/ssl/ssl_engine_io.c: Comment bio_filter_out_ctx_t.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@787644 13f79535-47bb-0310-9956-ffa450edef68
2009-06-23 11:53:33 +00:00
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
c719980d2d * Optimize access to server_rec.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771455 13f79535-47bb-0310-9956-ffa450edef68
2009-05-04 21:37:09 +00:00
8627001684 * As proposed by wrowe on list always define SSLStrictSNIVHostCheck, but error
out if we are not compiled against an SNI capable OpenSSL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@770907 13f79535-47bb-0310-9956-ffa450edef68
2009-05-02 07:47:59 +00:00
da160114d6 * Set SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN to on by default.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@769815 13f79535-47bb-0310-9956-ffa450edef68
2009-04-29 16:18:21 +00:00
506ed9e89e * Improve and simplify the implementation of SSLProxyCheckPeerExpire by
directly using X509_get_notBefore(), X509_get_notAfter() and
  X509_cmp_current_time().
  Thanks to jorton for the pointer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@769809 13f79535-47bb-0310-9956-ffa450edef68
2009-04-29 16:12:20 +00:00
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
01cc7f1069 * The state vinfo doesn't matter here: no client verification done at all.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@768501 13f79535-47bb-0310-9956-ffa450edef68
2009-04-25 09:28:21 +00:00
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
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
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
e468a9fae6 * Add SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN directives to enable
stricter checking of remote server certificates.

  (docs/manual/mod/mod_ssl.xml)
    Documentation of SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN.

  (modules/proxy/mod_proxy_http.c)
    Set the hostname of the request URL as note on the connection.

  (modules/ssl/ssl_private.h)
    Add proxy_ssl_check_peer_expire and proxy_ssl_check_peer_cn fields to
    the SSLSrvConfigRec.

  (modules/ssl/ssl_engine_config.c)
    Directives stuff for SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN.

  (modules/ssl/ssl_engine_io.c)
    Check whether the remote servers certificate is expired / if there is a
    mismatch between the requested hostanme and the remote server certificates
    CN field.
    Be able to parse ASN1 times.

  (modules/ssl/mod_ssl.c)
    Directives stuff for SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@760866 13f79535-47bb-0310-9956-ffa450edef68
2009-04-01 12:07:47 +00:00
e0eb7d1eef Introduce a new set of APIs to allow MPMs to be proper modules instead
of integral parts which share global variables, functions, and macros
with the rest of httpd.

Converted now:
  prefork, worker, event, simple, WinNT*

*WinNT hasn't been built or tested, and relies on a hack to include the
WinNT mpm.h to disable Unixy MPM support routines in mpm_common.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757853 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 15:43:59 +00:00
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
9e39ba015a * Store the correct server_rec in the connection record configuration and
adjust the remaining part of mod_ssl to use this server_rec instead of
  c->base_server.

  modules/ssl/ssl_private.h:
  - server_rec member to SSLConnRec struct
  - Add macros to extract data from connection_rec
    mySrvFromConn(c)
    mySrvConfigFromConn(c)
    myModConfigFromConn(c)
  modules/ssl/ssl_engine_io.c
  modules/ssl/ssl_util_ocsp.c
  modules/ssl/ssl_engine_kernel.c
  modules/ssl/mod_ssl.c
  modules/ssl/ssl_engine_log.c
  - Use the new macros to extract data fron connection_rec
    and use the server_rec stored in SSLConnRec instead of
    c->base_server whereever appropriate.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757463 13f79535-47bb-0310-9956-ffa450edef68
2009-03-23 17:37:38 +00:00
f67ffe3d58 Remove code to support per-dir-CA configuration which relies on a
function which was never included in OpenSSL:

* acinclude.m4: Remove test for fictional function.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Remove code.

* modules/ssl/ssl_engine_config.c (MODSSL_SET_CA): Remove unused
  macro.  (ssl_cmd_SSLCACertificatePath,
  ssl_cmd_SSLCACertificateFile): Fail if per-dir-CA is configured.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757380 13f79535-47bb-0310-9956-ffa450edef68
2009-03-23 11:45:00 +00:00
d5897d537b * If the SNI extension supplied a hostname. So don't accept requests with
either no hostname or a different hostname.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757373 13f79535-47bb-0310-9956-ffa450edef68
2009-03-23 10:51:00 +00:00
7d5d67750c Clean up more compiler emits. Add CHANGES entry, credit Kasper for the OpenSSL STACK fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@749466 13f79535-47bb-0310-9956-ffa450edef68
2009-03-02 23:17:53 +00:00
e171af3118 The development trunk of OpenSSL has tightened up the type safety of the STACK construct
and the functions that manipulate it.  Make httpd trunk compile against OpenSSL HEAD
as well as OpenSSL 0.9.8j.  Also, get rid of some warnings.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@748396 13f79535-47bb-0310-9956-ffa450edef68
2009-02-27 05:16:18 +00:00
0f6f55ba57 * Correctly merge SSLRenegBufferSize directive.
PR: 46508
Submitted by: <tlhackque yahoo.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733465 13f79535-47bb-0310-9956-ffa450edef68
2009-01-11 12:58:08 +00:00
b06785833f mod_ssl: Make the size of the per-dir-reneg request-body buffer
configurable, by popular demand:

* modules/ssl/ssl_private.h: Define DEFAULT_RENEG_BUFFER_SIZE.
  (SSLDirConfigRec): Add nRenegBufferSize field.

* modules/ssl/ssl_engine_config.c (ssl_cmd_SSLRenegBufferSize): New
  function.
  (ssl_config_perdir_create, ssl_config_perdir_merge): Handle
  nRenegBufferSize.

* modules/ssl/ssl_engine_io.c (ssl_io_buffer_fill): Take max buffer
  size as an argument rather than compile-time constant.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Pass
  nRenegBufferSize to ssl_io_buffer_fill.

* modules/ssl/mod_ssl.c (ssl_config_cmds): Add SSLRenegBufferSize.

PR: 39243


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726109 13f79535-47bb-0310-9956-ffa450edef68
2008-12-12 20:20:40 +00:00
aa062c60f3 socache API tweaks based on chrisd's review:
* include/ap_socache.h (ap_socache_provider_t::store): Take a pool.
  (ap_socache_provider_t::retrieve): Guarantee APR_NOTFOUND for a
  "not found" result.
  (ap_socache_provider_t::remove): Return an apr_status_t.

* modules/cache/mod_socache_dc.c, modules/cache/mod_socache_dbm.c,
  modules/cache/mod_socache_shmcb,
  modules/cache/mod_socache_memcache.c: Adjust accordingly.

* modules/ssl/ssl_scache.c (ssl_scache_store): Pass pool to
  sesscache->store.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726059 13f79535-47bb-0310-9956-ffa450edef68
2008-12-12 15:56:15 +00:00
e92019fdcb * modules/ssl/ssl_engine_config.c (ssl_cmd_SSLSessionCache): Allow
using socache provider config defaults by omitting the arguments, so
  e.g.  "SSLSessionCache shmcb" or even "SSLSessionCache default"
  should now DTRT.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726034 13f79535-47bb-0310-9956-ffa450edef68
2008-12-12 15:18:21 +00:00
5a83c545be * modules/ssl/ssl_private.h: Add a big fat warning about
the SSLModConfigRec lifetime.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724802 13f79535-47bb-0310-9956-ffa450edef68
2008-12-09 18:11:36 +00:00
61d7e254c9 * modules/ssl/ssl_engine_config.c (ssl_cmd_SSLSessionCache): Don't fix
the socache instance for the lifetime of the process since it is
  allocated out of pconf.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724789 13f79535-47bb-0310-9956-ffa450edef68
2008-12-09 17:26:50 +00:00
172d563455 * include/ap_socache.h: Use C++ safety wrappers, and rename ->delete
to ->remove since the former is a C++ reserved word.

* modules/ssl/ssl_scache.c (ssl_scache_remove): Update accordingly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724745 13f79535-47bb-0310-9956-ffa450edef68
2008-12-09 15:19:08 +00:00
778a79de65 Improve mod_ssl's environment variable extraction to correctly handle
DNs with duplicate tags:

* modules/ssl/ssl_engine_vars.c:
  Augment the ssl_var_lookup_ssl_cert_dn_rec table with a flag
  to indicate whether RDNs of the given NID should be extracted
  to the environment.
  (extract_dn, modssl_var_extract_dns): New functions.

* modules/ssl/ssl_private.h (modssl_var_extract_dns): Add prototype.

* modules/ssl/ssl_engine_kernel.c: Remove SSL_*_DN_ from the list
  of variables to insert into the environment.
  (ssl_hook_Fixup): Use modssl_var_extract_dns to insert the
  SSL_*_DN_ variables efficiently and accurately, handling
  certs with duplicate RDN tags correctly.

PR: 45875


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724717 13f79535-47bb-0310-9956-ffa450edef68
2008-12-09 14:41:21 +00:00
7c99ca3f93 * Another set of missed renames.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722544 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 17:57:46 +00:00
e1de193fc5 * Send Content-Type application/ocsp-request for POST requests to OSCP
responders.

PR: 46014
Submitted by: Dr Stephen Henson <steve openssl.org>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@704917 13f79535-47bb-0310-9956-ffa450edef68
2008-10-15 13:40:56 +00:00
e35f22e5a5 Move struct definition out of the header file since it is only used in this source file
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@687819 13f79535-47bb-0310-9956-ffa450edef68
2008-08-21 18:19:21 +00:00
c31e8fbb73 Implement dynamic mutex callbacks for the benefit of OpenSSL.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@687550 13f79535-47bb-0310-9956-ffa450edef68
2008-08-21 04:20:21 +00:00
98ab70975b * modules/ssl/ssl_engine_io.c (ssl_io_input_getline): Document
interface.
  (ssl_io_filter_input): For GETLINE mode, pull lines directly from
  the char_buffer if possible, to avoid unnecessarily copying the
  entire buffer once per invocation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@683283 13f79535-47bb-0310-9956-ffa450edef68
2008-08-06 14:45:48 +00:00
feabec3902 * modules/ssl/ssl_engine_io.c (char_buffer_read): Use memmove in place
of memcpy since the buffers can overlap; add explanatory comment.

PR: 45444


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@683280 13f79535-47bb-0310-9956-ffa450edef68
2008-08-06 14:37:09 +00:00