1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

249 Commits

Author SHA1 Message Date
Yann Ylavic
120f9ee886 mod_ssl: work around leaks on (graceful) restart.
Tested with valgrind and --with-ssl shared/static.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1781187 13f79535-47bb-0310-9956-ffa450edef68
2017-01-31 23:37:41 +00:00
Rainer Jung
7871d235f1 Remove calling ERR_remove_thread_state when
using OpenSSL 1.1.0.

This API is now a no-op in OpenSSL 1.1.0 and
deprecated.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755725 13f79535-47bb-0310-9956-ffa450edef68
2016-08-10 11:20:00 +00:00
Rainer Jung
92153fcc1d Compatibility with OpenSSL 1.1.0 pre6.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755657 13f79535-47bb-0310-9956-ffa450edef68
2016-08-09 23:09:46 +00:00
Yann Ylavic
f9ad2754f7 mod_proxy, mod_ssl: Handle SSLProxy* directives in <Proxy> sections,
allowing per backend TLS configuration.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1740928 13f79535-47bb-0310-9956-ffa450edef68
2016-04-26 00:04:57 +00:00
Rainer Jung
10e3eeda2f Support for OpenSSL 1.1.0:
- ERR_remove_thread_state() no longer has an
  argument.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735878 13f79535-47bb-0310-9956-ffa450edef68
2016-03-20 13:23:35 +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
Graham Leggett
1bd0dcce6d mod_ssl: Don't lose track of the SSL context if the ssl_run_pre_handshake()
hook returns an error.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734006 13f79535-47bb-0310-9956-ffa450edef68
2016-03-07 23:40:17 +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
Ruediger Pluem
aef1c86d73 * Introduce SSLOCSPProxyURL in order to do OCSP requests via a HTTP proxy.
Documentation to follow.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726881 13f79535-47bb-0310-9956-ffa450edef68
2016-01-26 20:24:33 +00:00
William A. Rowe Jr
ca266c4250 Better illustrate the ordering of hook processing
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1717810 13f79535-47bb-0310-9956-ffa450edef68
2015-12-03 17:17:18 +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
27028fe3f3 moved ssl handshake trigger from mod_http2 to new process_connection hook in mod_ssl
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1709602 13f79535-47bb-0310-9956-ffa450edef68
2015-10-20 14:13:06 +00:00
Kaspar Brand
4c9b3c3b35 Support compilation against libssl built with OPENSSL_NO_SSL3,
and change the compiled-in default for SSL[Proxy]Protocol to "all -SSLv3",
in accordance with RFC 7568. PR 58349, PR 57120.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1703952 13f79535-47bb-0310-9956-ffa450edef68
2015-09-19 08:40:56 +00:00
Kaspar Brand
73dbf35961 Add support for extracting the msUPN and dnsSRV forms
of subjectAltName entries of type "otherName" into
SSL_{CLIENT,SERVER}_SAN_OTHER_{msUPN,dnsSRV}_n environment
variables. Addresses PR 58020.

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

* modules/ssl/ssl_engine_vars.c: add support for retrieving the
  SSL_{CLIENT,SERVER}_SAN_OTHER_{msUPN,dnsSRV}_n variables

* modules/ssl/ssl_util_ssl.c: add parse_otherName_value, which
  currently recognizes the "msUPN" (1.3.6.1.4.1.311.20.2.3) and
  "id-on-dnsSRV" (1.3.6.1.5.5.7.8.7) otherName forms, and
  adapt modssl_X509_getSAN to take an optional otherName form
  argument for the GEN_OTHERNAME case

* modules/ssl/ssl_util_ssl.h: adapt modssl_X509_getSAN prototype

* modules/ssl/mod_ssl.c: register the id-on-dnsSRV otherName form
  OID (1.3.6.1.5.5.7.8.7) in OpenSSL's objects table


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1693792 13f79535-47bb-0310-9956-ffa450edef68
2015-08-02 07:30:45 +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
Jeff Trawick
9db0d19d21 mod_ssl OCSP Stapling: Don't block initial handshakes while refreshing
the OCSP response for a different certificate.  mod_ssl has an additional
global mutex, "ssl-stapling-refresh".

Not mentioned in CHANGES:

Stapling no longer uses a mutex when using a stapling cache
implementation which doesn't require it.  (A further, unrelated
code change to mod_ssl is required to allow the use of memcache 
as a stapling cache, and I haven't tested with distcache; thus
it isn't clear if this helps in practice yet.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1679032 13f79535-47bb-0310-9956-ffa450edef68
2015-05-12 18:59:29 +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
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
Jim Jagielski
17565ac48c ALPN support, based on mod_spdy/mod_h2 patch set
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1670397 13f79535-47bb-0310-9956-ffa450edef68
2015-03-31 17:12:51 +00:00
Jeff Trawick
6830babddd Provide separate SSL_CT_*_STATUS variables for client vs. proxy
connections, courtesy of a new flag passed from mod_ssl on its
pre_connection "optional hook."


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1661487 13f79535-47bb-0310-9956-ffa450edef68
2015-02-22 15:50:54 +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
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
Jeff Trawick
f82af68aa4 mod_ssl: Add hooks to allow other modules to perform processing at
several stages of initialization and connection handling.  See
mod_ssl_openssl.h.

This is enough to allow implementation of Certificate Transparency
outside of mod_ssl.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587607 13f79535-47bb-0310-9956-ffa450edef68
2014-04-15 15:25:03 +00:00
Yann Ylavic
6508ac17c2 mod_ssl: send OCSP request's nonce according to SSLOCSPUseRequestNonce on/off. PR 56233.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1583191 13f79535-47bb-0310-9956-ffa450edef68
2014-03-30 19:25:20 +00:00
Kaspar Brand
e7dc6dd3f4 Remove SSLPKCS7CertificateFile support:
- was never documented, so very unlikely that it was ever used

- adds complexity without apparent benefit; PKCS#7 files can
  be trivially converted to a file for use with SSLCertificateChainFile
  (concatenated X509 CERTIFICATE chunks, openssl pkcs7 -print_certs...)

- only supports PKCS7 files with PEM encoding, i.e. relies on a
  non-standardized PEM header (cf. RFC 2315 and draft-josefsson-pkix-textual)

- issues pointed out in http://mail-archives.apache.org/mod_mbox/httpd-dev/200607.mbox/%3C20060723093125.GA19423@redhat.com%3E
  were never fully addressed (cf. r424707 and r424735)

- has never worked in vhost context due to a cfgMergeString
  call missing from modssl_ctx_cfg_merge


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1544784 13f79535-47bb-0310-9956-ffa450edef68
2013-11-23 13:03:25 +00:00
Kaspar Brand
725978c554 Increase minimum required OpenSSL version to 0.9.8a (in preparation
for the next mod_ssl commit, which will rely on the get_rfcX_prime_Y
functions added in that release):

- remove obsolete #defines / macros

- in ssl_private.h, regroup definitions based on whether
  they depend on TLS extension support or not

- for ECC and SRP support, set HAVE_X and change the rather awkward
  #ifndef OPENSSL_NO_X lines accordingly

For the discussion prior to taking this step, see
https://mail-archives.apache.org/mod_mbox/httpd-dev/201309.mbox/%3C524275C7.9060408%40velox.ch%3E


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1527294 13f79535-47bb-0310-9956-ffa450edef68
2013-09-29 10:12:47 +00:00
Kaspar Brand
a6a324f9bb Streamline ephemeral key handling:
- drop support for ephemeral RSA keys (only allowed/needed
  for export ciphers)

- drop pTmpKeys from the per-process SSLModConfigRec, and remove
  the temp key generation at startup (unnecessary for DHE/ECDHE)

- unconditionally disable null and export-grade ciphers by always
  prepending "!aNULL:!eNULL:!EXP:" to any cipher suite string

- do not configure per-connection SSL_tmp_*_callbacks, as it is
  sufficient to set them for the SSL_CTX

- set default curve for ECDHE at startup, obviating the need
  for a per-handshake callback, for the time being (and also
  configure SSL_OP_SINGLE_ECDH_USE, previously left out)

For additional background, see
https://mail-archives.apache.org/mod_mbox/httpd-dev/201309.mbox/%3C52358ED1.2070704@velox.ch%3E


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1526168 13f79535-47bb-0310-9956-ffa450edef68
2013-09-25 12:52:35 +00:00
Jeff Trawick
5f4229ac0d SSLCompression help text:
add missing space between directive description and syntax


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1509983 13f79535-47bb-0310-9956-ffa450edef68
2013-08-03 13:17:37 +00:00
Joe Orton
4c35482180 Remove unnecessary global declarations of optional function
implementations:

* modules/ssl/mod_ssl.c (ssl_proxy_enable, ssl_engine_disable): Mark
  static.

* modules/ssl/ssl_private.h (ssl_proxy_enable, ssl_engine_disable):
  Remove declarations.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1487775 13f79535-47bb-0310-9956-ffa450edef68
2013-05-30 07:23:52 +00:00
Joe Orton
b3ce136d05 mod_ssl: Redesign NPN (Next Protocol Negotiation) API to avoid use of
hooks API and inter-module hard linkage:

* modules/ssl/mod_ssl.h: Remove NPN hooks, add "modssl_register_npn"
  optional function and callback function type declarations for
  ssl_npn_advertise_protos, ssl_npn_proto_negotiated.

* modules/ssl/mod_ssl.c: Drop hooks.
  (modssl_register_npn): New optional function implementation.
  (ssl_register_hooks): Register it.

* modules/ssl/ssl_private.h (SSLConnRec): Add npn_advertfns,
  npn_negofns array fields.

* modules/ssl/ssl_engine_kernel.c (ssl_callback_AdvertiseNextProtos): 
  Replace use of hook API with array iteration.

* modules/ssl/ssl_engine_io.c (ssl_io_filter_input): Likewise.

Reviewed by: Matthew Steele <mdsteele google.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1487772 13f79535-47bb-0310-9956-ffa450edef68
2013-05-30 07:19:07 +00:00
Kaspar Brand
1c780f18be revert r1352596, for the reasons explained in
https://mail-archives.apache.org/mod_mbox/httpd-dev/201304.mbox/%3C515FED7C.5010009%40velox.ch%3E


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1468131 13f79535-47bb-0310-9956-ffa450edef68
2013-04-15 15:56:07 +00:00
Guenter Knauf
8b3b94f8c0 Removed tabs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1451108 13f79535-47bb-0310-9956-ffa450edef68
2013-02-28 06:09:12 +00:00
Stefan Fritsch
8736e6a6d0 Avoid valgrind warnings in mod_ssl random number generator
We intentionally add uninitialized stack memory. To avoid warnings,
make valgrind believe that the memory is defined.

Add configure option to enable valgrind support


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1442307 13f79535-47bb-0310-9956-ffa450edef68
2013-02-04 19:34:08 +00:00
Kaspar Brand
50eb694c34 mod_ssl: add support for subjectAltName-based host name checking in proxy mode
(PR 54030)

factor out code from ssl_engine_init.c:ssl_check_public_cert()
to ssl_util_ssl.c:SSL_X509_match_name()

introduce new SSLProxyCheckPeerName directive, which should eventually
obsolete SSLProxyCheckPeerCN

ssl_engine_io.c:ssl_io_filter_handshake(): avoid code duplication
when aborting with HTTP_BAD_GATEWAY


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1425874 13f79535-47bb-0310-9956-ffa450edef68
2012-12-26 10:54:54 +00:00
Stephen Henson
2f58146bae Add support for OpenSSL configuration commands.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1421323 13f79535-47bb-0310-9956-ffa450edef68
2012-12-13 14:52:47 +00:00
Stephen Henson
2fb0965919 Avoid use of deprecated functions for OpenSSL version >= 1.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1421305 13f79535-47bb-0310-9956-ffa450edef68
2012-12-13 14:12:45 +00:00
Guenter Knauf
83006c70f1 Removed trailing semicolons.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1374941 13f79535-47bb-0310-9956-ffa450edef68
2012-08-20 08:14:13 +00:00
Ben Laurie
d79a70a76a RFC 5878 support.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1352596 13f79535-47bb-0310-9956-ffa450edef68
2012-06-21 16:17:41 +00:00
Stefan Fritsch
ccf77a856a Add support for TLS-SRP (Secure Remote Password key exchange
for TLS, RFC 5054).

PR: 51075
Submitted by: Quinn Slack <sqs cs stanford edu>, Christophe Renou,
              Peter Sylvester


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1347980 13f79535-47bb-0310-9956-ffa450edef68
2012-06-08 09:38:44 +00:00
Stefan Fritsch
510d3f904e Add new directive SSLCompression to disable SSL-level compression.
PR: 53219
Submitted by: Björn Jacke <bjoern j3e de>, Stefan Fritsch


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1345319 13f79535-47bb-0310-9956-ffa450edef68
2012-06-01 19:36:37 +00:00
Joe Orton
dd5f55ce6b Add support for TLS Next Protocol Negotiation:
* modules/ssl/mod_ssl.c, modules/ssl/mod_ssl.h: Add and implement new
  hooks for next protocol advertisement/discovery.

* modules/ssl/ssl_engine_init.c (ssl_init_ctx_callbacks): Enable
  NPN advertisement callback in handshake.

* modules/ssl/ssl_engine_io.c (ssl_io_filter_input): Invoke
  next-protocol discovery hook.

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

* modules/ssl/ssl_private.h: Add prototype.

Submitted by: Matthew Steele <mdsteele google.com>
  with slight tweaks by jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1332643 13f79535-47bb-0310-9956-ffa450edef68
2012-05-01 13:27:14 +00:00
Kaspar Brand
a30532d2a7 Fix another case of #ifdef-within-a-macro (which was inadvertently
introduced a few days ago).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1225791 13f79535-47bb-0310-9956-ffa450edef68
2011-12-30 10:39:00 +00:00
Kaspar Brand
1af61dfb2e SSLProtocol: allow explicit control of TLSv1.1 and TLSv1.2 flavors when
compiled against OpenSSL 1.0.1 or later. Update documentation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1222921 13f79535-47bb-0310-9956-ffa450edef68
2011-12-24 06:40:10 +00:00
Kaspar Brand
8d37f73ce7 Streamline TLS session ticket key handling (added in r1200040):
- drop the SSLTicketKeyDefault directive, and only support a single
  ticket key per server/vhost
- rename the SSLTicketKeyFile directive to SSLSessionTicketKeyFile,
  remove the keyname parameter
- move ticket key parameters from SSLSrvConfigRec to modssl_ctx_t
- configure the tlsext_ticket_key_cb only when in server mode
- add documentation for SSLSessionTicketKeyFile


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1213380 13f79535-47bb-0310-9956-ffa450edef68
2011-12-12 19:21:35 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +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
Stefan Fritsch
1951a037bf More cleanup: Expand tabs and some more indentation fixes
No functional change


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174929 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:08:42 +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