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

1202 Commits

Author SHA1 Message Date
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
Jeff Trawick
c51e4d9cbc Add module mod_ssl_ct, which provides an implementation of Certificate
Transparency (RFC 6962) for httpd.

mod_ssl_ct requires OpenSSL 1.0.2 (in beta) and must be explicitly
enabled via configure.

Note that support/ctauditscts is purposefully not installed; it
does not properly function due to a dependency on a 
certificate-transparency open source project tool which itself is
not sufficiently complete at this time.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588987 13f79535-47bb-0310-9956-ffa450edef68
2014-04-21 21:14:21 +00:00
Jeff Trawick
4af211f0ef Initialize post_handshake_rc for case where a failure has
already occurred (doesn't change execution but avoids warning
with some levels of gcc).

Pointed out by: kbrand


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588868 13f79535-47bb-0310-9956-ffa450edef68
2014-04-21 11:03:26 +00:00
Kaspar Brand
afe9fee88c ssl_stapling_init_cert: do not return success when no responder URI is found
stapling_renew_response: abort early (before apr_uri_parse) if ocspuri is empty


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588853 13f79535-47bb-0310-9956-ffa450edef68
2014-04-21 06:54:41 +00:00
Kaspar Brand
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
Kaspar Brand
0fca81d239 Also clear the error queue before calling SSL_CTX_use_certificate[_chain]_file
(workaround for OpenSSL versions before 0.9.8h, see
https://rt.openssl.org/Ticket/Display.html?user=guest&pass=guest&id=1513).

PR 56410.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588427 13f79535-47bb-0310-9956-ffa450edef68
2014-04-18 09:07:19 +00:00
Jeff Trawick
7c00e38807 Follow up to r1587607:
The init_server hook is responsible for telling why init
failed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587635 13f79535-47bb-0310-9956-ffa450edef68
2014-04-15 17:00:24 +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
Jeff Trawick
f5ec1f9b30 remove stray character in comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1586727 13f79535-47bb-0310-9956-ffa450edef68
2014-04-11 17:41:41 +00:00
Kaspar Brand
b65275e2e9 Reverse the order when merging global and vhost-level config arrays.
Putting the vhost-level elements last allows overriding global settings
(for the deprecated SSLRequire directive, the order is irrelevant,
all of them must be met, cf. ssl_engine_kernel.c:ssl_hook_Access).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1585919 13f79535-47bb-0310-9956-ffa450edef68
2014-04-09 09:38:02 +00:00
Kaspar Brand
50ebf352a8 Only read "active" values from the key_files array. PR 56306.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1585918 13f79535-47bb-0310-9956-ffa450edef68
2014-04-09 09:35:41 +00:00
Kaspar Brand
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
Yann Ylavic
0e37047e3d mod_ssl: follow up to r1583191.
New SSLOCSPUseRequestNonce directive's manual and CHANGES.

Non functional code changes (modssl_ctx_t's field ocsp_use_request_nonce
grouped with other OCSP ones, nested if turned to a single AND condition).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1584098 13f79535-47bb-0310-9956-ffa450edef68
2014-04-02 17:21:28 +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
Stephen Henson
72889d15f8 A bug in some older versions of OpenSSL will cause a crash
in SSL_get_certificate for servers where the certificate hasn't
been sent.

Workaround by setting the ssl structure to client mode which
bypasses the faulty code in OpenSSL. Normally setting a server
ssl structure to client mode would cause problems later on:
but we are freeing the structure immediately without attempting
to use it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1576741 13f79535-47bb-0310-9956-ffa450edef68
2014-03-12 13:52:26 +00:00
Victor J. Orlikowski
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
Christophe Jaillet
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
Kaspar Brand
ba0d11111a update APLOGNO for r1564760
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1565081 13f79535-47bb-0310-9956-ffa450edef68
2014-02-06 05:25:12 +00:00
Kaspar Brand
1f3cc513a0 With OpenSSL 1.0.2 or later, enable OCSP stapling in a loop based on
SSL_CTX_set_current_cert(), near the end of ssl_init_server_ctx.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1564760 13f79535-47bb-0310-9956-ffa450edef68
2014-02-05 13:02:35 +00:00
Jeff Trawick
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
Kaspar Brand
55f9574e26 enable auto curve selection for ephemeral ECDH keys
when compiled against OpenSSL 1.0.2 or later


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1563420 13f79535-47bb-0310-9956-ffa450edef68
2014-02-01 14:04:23 +00:00
Kaspar Brand
b83efdbb99 Followup fix for r1553824:
also pass the file name to ssl_load_encrypted_pkey, to make sure that we
retry with the same filename we used for SSL_CTX_use_PrivateKey_file first


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1563417 13f79535-47bb-0310-9956-ffa450edef68
2014-02-01 13:57:06 +00:00
Jan Kaluža
cc94935e7e mod_ssl: Do not print content of SSL CA directories during -DDUMP_CA_CERTS, make
-DDUMP_CERTS and -DDUMP_CA_CERTS mutually exclusive and document them.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1558775 13f79535-47bb-0310-9956-ffa450edef68
2014-01-16 12:49:37 +00:00
Joe Orton
7f2edaa14e * modules/ssl/ssl_engine_config.c (ssl_cmd_SSLCompression): Fail if
enabled *and* if OpenSSL does not make any compression methods
  available.  Tweak wording for failure without SSL_OP_NO_COMPRESSION.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1556473 13f79535-47bb-0310-9956-ffa450edef68
2014-01-08 09:39:44 +00:00
Jeff Trawick
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
Kaspar Brand
4c079f6ff3 make the ppcb_arg initialization a bit more uniform and easier to read
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555467 13f79535-47bb-0310-9956-ffa450edef68
2014-01-05 07:58:54 +00:00
Kaspar Brand
a84af8f546 More finishing touches for SSLOpenSSLConfCmd:
- add documentation
- clear the error queue before executing the next SSL_CONF_cmd
- if needed, configure OCSP stapling after a "Certificate" command
- ifdef ssl_cmd_SSLOpenSSLConfCmd in ssl_private.h


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555464 13f79535-47bb-0310-9956-ffa450edef68
2014-01-05 07:38:28 +00:00
Kaspar Brand
c0e4f862ad Remove per-certificate chain handling code (obsoleted by
https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=b9fa413a08d436d6b522749b5e808fcd931fd943)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555463 13f79535-47bb-0310-9956-ffa450edef68
2014-01-05 07:15:59 +00:00
Jeff Trawick
fcf66e6281 fix typo in error message
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555423 13f79535-47bb-0310-9956-ffa450edef68
2014-01-04 21:44:34 +00:00
Ruediger Pluem
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
Guenter Knauf
162153718f CodeWarrior compiler doesnt allow vars as struct inits.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1554192 13f79535-47bb-0310-9956-ffa450edef68
2013-12-30 11:31:37 +00:00
Kaspar Brand
1e80b68ec1 Remove the hardcoded algorithm-type dependency for the SSLCertificateFile
and SSLCertificateKeyFile directives, and deprecate SSLCertificateChainFile

Splitting the patch into smaller pieces turned out to be infeasible,
unfortunately, due to the heavily intertwined code in ssl_engine_config.c,
ssl_engine_init.c and ssl_engine_pphrase.c, which all depends on the
modssl_pk_server_t data structure. For better comprehensibility,
a detailed listing of the changes follows:

ssl_private.h
- drop the X509 certs and EVP_PKEY keys arrays from modssl_pk_server_t
- use apr_array_header_t for cert_files and key_files
- drop tPublicCert from SSLModConfigRec
- drop the ssl_algo_t struct and the SSL_ALGO_* and SSL_AIDX_* constants

ssl_engine_config.c
- change to apr_array_header_t for SSLCertificate[Key]File
- drop ssl_cmd_check_aidx_max, i.e. allow an arbitrary number of certs
  and keys (in theory; currently OpenSSL does not support more than
  one cert/key per algorithm type)
- add deprecation warning for SSLCertificateChainFile

ssl_engine_init.c
- configure server certs/keys in ssl_init_server_certs (no longer via
  ssl_pphrase_Handle in ssl_init_Module)
- in ssl_init_server_certs, read in certificates and keys with standard
  OpenSSL API functions (SSL_CTX_use_*_file), and only fall back to
  ssl_load_encrypted_pkey when encountering an encrypted private key
- drop ssl_server_import_cert, ssl_server_import_key, ssl_init_server_check,
  and ssl_init_ctx_cleanup_server
- move the "problematic re-initialization" check to ssl_init_server_ctx

ssl_engine_pphrase.c
- use servername:port:index as the key identifier, instead of the
  previously used servername:port:algorithm
- ssl_pphrase_Handle overhaul: remove all cert/public-key handling,
  make it only load a single (encrypted) private key, and rename
  to ssl_load_encrypted_pkey
- in the passphrase prompt message, show the private key file name
  instead of the vhost id and the algorithm name
- do no longer supply the algorithm name as an argument to "exec"-type
  passphrase prompting programs

ssl_util.c
- drop ssl_util_algotypeof, ssl_util_algotypestr, ssl_asn1_keystr,
  and ssl_asn1_table_keyfmt

ssl_util_ssl.{c,h}
- drop SSL_read_X509
- constify the filename arg for SSL_read_PrivateKey


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1553824 13f79535-47bb-0310-9956-ffa450edef68
2013-12-28 13:24:17 +00:00
Ruediger Pluem
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
Jan Kaluža
bdad52f9e2 mod_ssl: Add -t -DDUMP_CA_CERTS option which dumps the filenames of all
configured SSL CA certificates to stdout the same way as DUMP_CERTS does.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1550060 13f79535-47bb-0310-9956-ffa450edef68
2013-12-11 07:16:28 +00:00
Kaspar Brand
36578aad16 SGC became dead in January 2000, effectively
(http://www.gpo.gov/fdsys/pkg/FR-2000-01-14/pdf/00-983.pdf)
Almost 14 years later, there's certainly no longer any need
to spit out some fancy log message.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1546805 13f79535-47bb-0310-9956-ffa450edef68
2013-12-01 11:57:42 +00:00
Kaspar Brand
59d183695b Throw away the myCtxVar{Set,Get} abomination and introduce
a pphrase_cb_arg_t struct instead, for passing stuff between
ssl_pphrase_Handle and ssl_pphrase_Handle_CB. Prefer struct
members instead of using additional local variables, to make
the data flow more transparent. (Doesn't "vastly simplify"
the code yet, but hopefully we'll get there when further
stripping down ssl_pphrase_Handle.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1546804 13f79535-47bb-0310-9956-ffa450edef68
2013-12-01 11:52:44 +00:00
Kaspar Brand
5289285387 Tweaks for SSLOpenSSLConfCmd:
- use cfgMergeArray, and reduce the size of the initial array
- move SSL_CONF_cmd calls from ssl_init_ctx_protocol to
  ssl_init_server_ctx (so they are applied after ssl_init_server_certs)
- add APLOG_DEBUG-level logging for the SSL_CONF_cmd success case
- call SSL_CONF_CTX_free(cctx) when done in ssl_init_server_ctx


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1546693 13f79535-47bb-0310-9956-ffa450edef68
2013-11-30 07:44:27 +00:00
Kaspar Brand
6cabf7d3dc Axe dead code: It wouldn't have been needed ever since httpd 2.0.35
was released in April 2002... it was fixed in the [unreleased]
SSLeay 0.9.1b, which was the basis for the initial OpenSSL 0.9.1c
release in December 1998 (specifically, it's this change to ssl_set_pkey():
https://cvs.openssl.org/filediff?f=openssl/ssl/ssl_rsa.c&v1=1.1.1.2&v2=1.1.1.3)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1546692 13f79535-47bb-0310-9956-ffa450edef68
2013-11-30 07:17:53 +00:00
Kaspar Brand
ec13db2b0c Followup to r1544774: do not ignore failures from ssl_server_import_{cert,key}
in ssl_init_server_certs


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1544812 13f79535-47bb-0310-9956-ffa450edef68
2013-11-23 15:01:08 +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
7d402a24ec Address a todo listed in
https://mail-archives.apache.org/mod_mbox/httpd-dev/200205.mbox/%3CPine.LNX.4.33.0205292300380.27841-100000%40mako.covalent.net%3E
"init functions should return status code rather than ssl_die()"

For diagnostic purposes, ssl_die() is still there, but instead
of abruptly exit(1)ing, it will return APR_EGENERAL to the
ssl_init_* callers in ssl_engine_init.c, and these will propagate
the status back to ssl_init_Module.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1544774 13f79535-47bb-0310-9956-ffa450edef68
2013-11-23 12:22:47 +00:00
Graham Leggett
6aafe58a02 mod_ssl: Don't flush when an EOS is received. Prepares mod_ssl
to support write completion.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1542546 13f79535-47bb-0310-9956-ffa450edef68
2013-11-16 18:50:45 +00:00
Joe Orton
ba43a875fd For better compatibility with mod_nss:
* modules/ssl/ssl_engine_config.c (ssl_config_server_new): Default
  sc->enabled to UNSET.

* modules/ssl/ssl_engine_init.c (ssl_init_Module): Only override
  sc->enabled based on the protocol iff sc->enabled is UNSET; allows
  "SSLEngine off" to override the Listen-based default.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1537535 13f79535-47bb-0310-9956-ffa450edef68
2013-10-31 15:42:08 +00:00
Jeff Trawick
f0153228f5 axe attempt to close a previously-closed apr socket
(clang scan-build says "uninitialized", but it doesn't know
how apr_sockaddr_info_get() reports errors)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1534890 13f79535-47bb-0310-9956-ffa450edef68
2013-10-23 01:25:05 +00:00