1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

233 Commits

Author SHA1 Message Date
Joe Orton
bba7b9805a mod_ssl: Add support for loading TLS certificates through the PKCS#11
engine.

* modules/ssl/ssl_util.c (modssl_is_engine_id): Renamed
  from modssl_is_engine_key.
  
* modules/ssl/ssl_engine_config.c (ssl_cmd_SSLCertificateKeyFile):
  Adjust accordingly.
  (ssl_cmd_SSLCertificateFile): Also allow ENGINE cert ids.

* modules/ssl/ssl_engine_pphrase.c (modssl_load_engine_keypair):
  Rename from modssl_load_engine_key; load certificate if
  cert id is passed.

* modules/ssl/ssl_engine_init.c (ssl_init_server_certs): Optionally
  load the certificate from the engine as well.

* docs/manual/: Update manual.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1831168 13f79535-47bb-0310-9956-ffa450edef68
2018-05-08 12:39:22 +00:00
Joe Orton
9e4ad2f685 Simplify the ssl_asn1_table API, remove abstraction (it is used only
to cache serialized EVP_PKEYs not any char * blobs), and document.

* modules/ssl/ssl_util.c (ssl_asn1_table_set): Take the EVP_PKEY and
  serialize internally.  Use ap_realloc.  Return the ssl_asn1_t *
  pointer.  Don't call apr_hash_set() for unchanged pointer case.

* modules/ssl/ssl_engine_pphrase.c (ssl_load_encrypted_pkey):
  Adjust for the above.

* modules/ssl/ssl_private.h: Adjust as above, add docs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1830927 13f79535-47bb-0310-9956-ffa450edef68
2018-05-04 17:56:32 +00:00
Joe Orton
04294308f6 mod_ssl: Add support for loading private keys from ENGINEs. Support
for PKCS#11 URIs only, and PIN entry is not threaded through
SSLPassPhraseDialog config yet.

* modules/ssl/ssl_util.c (modssl_is_engine_key): New function.

* modules/ssl/ssl_engine_config.c (ssl_cmd_SSLCertificateKeyFile):
  Use it, skip check for file existence for engine keys.

* modules/ssl/ssl_engine_pphrase.c (modssl_load_engine_pkey):
  New function.

* modules/ssl/ssl_engine_init.c (ssl_init_server_certs):
  For engine keys, load via modssl_load_engine_pkey.

Submitted by: Anderson Sasaki <ansasaki redhat.com>, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1830819 13f79535-47bb-0310-9956-ffa450edef68
2018-05-03 13:06:46 +00:00
Joe Orton
c16933db8c * modules/ssl/ssl_util.c (modssl_request_is_tls): Adjust
to take SSLConnRec * out parameter rather than SSL *.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_UserCheck): Use it here.
  (ssl_hook_Fixup): Adjust use.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1829263 13f79535-47bb-0310-9956-ffa450edef68
2018-04-16 12:36:42 +00:00
Joe Orton
fb92787465 Factor out logic to determine if request is using SSL/TLS and use it
consistently.

* modules/ssl/ssl_util.c (modssl_request_is_tls): New function.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Fixup): Use it.

* modules/ssl/mod_ssl.c (ssl_hook_http_scheme, ssl_hook_default_port):
  Use it.

PR: 61519


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1829250 13f79535-47bb-0310-9956-ffa450edef68
2018-04-16 10:14:25 +00:00
Stefan Eissing
c9e9ecff20 On the trunk:
mod_ssl: proper checks for libressl 2.07/8 and its TLSv1_3 support, see PR 62236.
     [Bernard Spil <brnrd@freebsd.org>]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828222 13f79535-47bb-0310-9956-ffa450edef68
2018-04-03 12:19:28 +00:00
Stefan Eissing
352d92c698 On the trunk:
mod_ssl TLSv1.3 support, removed V1_3 cipher suite directives again and added an optional protocol specifier to the SSLCipherSuite and SSLProxyCipherSuite commands.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827992 13f79535-47bb-0310-9956-ffa450edef68
2018-03-29 14:10:12 +00:00
Stefan Eissing
8b305c8397 On the trunk:
mod_ssl: Added configuration directives for TLSv1.3 cipher suites (which
     are separate from previous ones) as SSL(Proxy)CipherSuiteV1_3. A great opportunity
     to find a better name.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827924 13f79535-47bb-0310-9956-ffa450edef68
2018-03-28 15:38:51 +00:00
Stefan Eissing
2ab41d39d8 On the trunk:
mod_ssl: add support for TLSv1.3 (tested with OpenSSL v1.1.1-pre3, other libs may
     need more sugar). 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827912 13f79535-47bb-0310-9956-ffa450edef68
2018-03-28 11:15:18 +00:00
Stefan Eissing
1c9a4b1a2a On the trunk:
mod_ssl: reverting r1807709 (SSLEngine with addr:port spec) as a "seemed a good idea at the time" thing.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827760 13f79535-47bb-0310-9956-ffa450edef68
2018-03-26 13:09:27 +00:00
Stefan Eissing
f8df6dc61a On the trunk:
mod_ssl: heavily simplified SSLPolicy. No more user defines, no propxy policies,
     just the basic "modern", "intermediate" and "old" as specified by Mozilla security.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827561 13f79535-47bb-0310-9956-ffa450edef68
2018-03-23 12:24:29 +00:00
Stefan Eissing
1184290ddd Extend SSLOCSPEnable with mode 'leaf' that only checks the leaf of a certificate chain. PR62112 [Ricardo Martin Camarero <rickyepoderi@yahoo.es>]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1826995 13f79535-47bb-0310-9956-ffa450edef68
2018-03-16 15:25:08 +00:00
Joe Orton
b5bdda4073 * modules/ssl/ssl_private.h: Remove unused macros.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809297 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 10:33:08 +00:00
Stefan Eissing
55956ee619 On the trunk:
mod_ssl: Extending SSLEngine to alternatively get a list of add:port spec as used in VirtualHost.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1807709 13f79535-47bb-0310-9956-ffa450edef68
2017-09-08 10:29:53 +00:00
Stefan Eissing
e4431e60a4 On the trunk:
mod_ssl: adding SSLPolicy and SSLProxyPolicy directives plus documentation.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805182 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 12:22:28 +00:00
Stefan Eissing
e7a858c2bd branch for integrating mod_md into trunk
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/trunk-md@1804087 13f79535-47bb-0310-9956-ffa450edef68
2017-08-04 09:52:04 +00:00
Yann Ylavic
31a4103652 mod_ssl, ab: compatibility with LibreSSL. PR 61184.
LibreSSL defines OPENSSL_VERSION_NUMBER = 2.0, but is not compatible with
all of the latest OpenSSL 1.1 API.

Address this by defining MODSSL_USE_OPENSSL_PRE_1_1_API which is true for
anything but OpenSSL >= 1.1 (for now).

Proposed by: Bernard Spil <brnrd freebsd.org>
Reviewed by: ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1803396 13f79535-47bb-0310-9956-ffa450edef68
2017-07-29 23:05:02 +00:00
Yann Ylavic
cee2df66f0 mod_ssl: follow up to r1781575
Fix SSLOCSPNoVerify merging, and while at it capitalize Verify as suggested
by wrowe.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1788430 13f79535-47bb-0310-9956-ffa450edef68
2017-03-24 12:40:27 +00:00
Jean-Frederic Clere
f6146b725c Add Configuration for trusted OCSP responder certificates
Fix for PR 46037


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1781575 13f79535-47bb-0310-9956-ffa450edef68
2017-02-03 16:19:17 +00:00
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
bd14694a65 OpenSSL 1.1.0 compat:
- move IDCONST macro outside of addition #if check.
  Otherwise we break compatibility with old
  OpenSSL 0.9.8 releases.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755856 13f79535-47bb-0310-9956-ffa450edef68
2016-08-10 20:58:22 +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
e387d3e9c7 Support for OpenSSL 1.1.0:
- X509_STORE_CTX is now opaque.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1740653 13f79535-47bb-0310-9956-ffa450edef68
2016-04-23 13:17:52 +00:00
Rainer Jung
6ba30d2c2b Support for OpenSSL 1.1.0:
- symbols get_rfc..._prime_... have been
  renamed to BN_get_rfc..._prime_...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1740652 13f79535-47bb-0310-9956-ffa450edef68
2016-04-23 12:36:43 +00:00
Rainer Jung
89db09bb58 Support for OpenSSL 1.1.0:
- DH was made opaque


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738410 13f79535-47bb-0310-9956-ffa450edef68
2016-04-10 09:02:15 +00:00
Rainer Jung
f31ec0318d Support for OpenSSL 1.1.0:
- BIO was made opaque after OpenSSL 1.1.0pre4.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1737657 13f79535-47bb-0310-9956-ffa450edef68
2016-04-04 11:33:31 +00:00
Rainer Jung
8bcf9ed952 Support for OpenSSL 1.1.0:
- Followup to r1735875:
    ssl_util_thread_setup() is gone.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735925 13f79535-47bb-0310-9956-ffa450edef68
2016-03-21 08:47:15 +00:00
Rainer Jung
dcf2165a63 Support for OpenSSL 1.1.0:
- The callback function passed to
  SSL_CTX_sess_set_get_cb() now needs the
  session id argument to be const.
  So constify the session id.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735883 13f79535-47bb-0310-9956-ffa450edef68
2016-03-20 14:23:06 +00:00
Yann Ylavic
5bc7c3ca2d mod_ssl: follow up to r1734561.
Simplify CRL check mode and flags handling/merging by using a single mask (int).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735337 13f79535-47bb-0310-9956-ffa450edef68
2016-03-16 22:54:27 +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
Rainer Jung
d7639a5ad0 Support OpenSSL 1.1.0.
- use common code for OpenSSL pre-1.1.0 and
  1.1.0 where possible.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730422 13f79535-47bb-0310-9956-ffa450edef68
2016-02-14 22:40:07 +00:00
Rainer Jung
e2017967f9 Support for OpenSSL 1.1.0:
- use SSL_peek instead of looping with
  has_buffered_data().

This fixes t/security/CVE-2009-3555.t where
has_buffered_data() doesn't help, because it
finds the buffered data and doesn't call
SSL_read(), so the reneg handshake isn't
triggered. SSL_peek() for 0 bytes seems to
reliably trigger the reneg in every case.

No more polling/sleeping. The code for the
OpenSSL 1.1.0 case is now again very close to
the pre 1.1.0 case.

Still need to run the full test suite with a
clean build.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730316 13f79535-47bb-0310-9956-ffa450edef68
2016-02-14 11:24:39 +00:00
Rainer Jung
9f4bd17eda Support for OpenSSL 1.1.0:
- fix copy&paste typos
  (wrong version number in "#if").


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729998 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 11:29:36 +00:00
Rainer Jung
4741048ff3 Support for OpenSSL 1.1.0:
- further improvements for renegotiation
No more test suite failures for reneg,
but still using not so nice polling.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729927 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 00:44:22 +00:00
Rainer Jung
3afb174383 Fix compiler warning when using OpenSSL 1.1.0.
The old compatibility macro check no longer works,
because those are now actual functions, so an
ifndef is not the correct check.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729435 13f79535-47bb-0310-9956-ffa450edef68
2016-02-09 18:10:11 +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
Christophe Jaillet
cf3cb2849f Constify + save a few bytes in conf pool when parsing SSLRequire
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1718514 13f79535-47bb-0310-9956-ffa450edef68
2015-12-08 06:34:48 +00:00
Yann Ylavic
b7693e5941 mod_ssl: follow up to r1709602.
Fix "HTTP spoken on HTTPS port" broken by the SSL handshake trigger moved to
process_connection hook (r1709602) along with H2Direct speculative read.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715023 13f79535-47bb-0310-9956-ffa450edef68
2015-11-18 17:15:24 +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
Jeff Trawick
69deb80190 Follow-up to r1702948:
APR_HAVE_foo is checked via #if, not #ifdef (since it should always be
defined, to either 0 or 1)

This fixes a compile error on Windows introduced by r1702948
as well as straightens up two long-time glitches.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1706595 13f79535-47bb-0310-9956-ffa450edef68
2015-10-03 14:55:43 +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
Stefan Eissing
cf6c7246d5 first stab at a better SNI vs. request name matching, by accounting for serveralias and wildcards
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1698330 13f79535-47bb-0310-9956-ffa450edef68
2015-08-28 13:00:52 +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
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
Rainer Jung
970818995c Simplify. Checking for OPENSSL_NO_TLSEXT already
happens in a surrounding block.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1675549 13f79535-47bb-0310-9956-ffa450edef68
2015-04-23 07:33:34 +00:00
Rainer Jung
77a253bf3e HAVE_TLS_NPN was defined twice in this file.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1675459 13f79535-47bb-0310-9956-ffa450edef68
2015-04-22 19:29:07 +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