Commit Graph

286 Commits

Author SHA1 Message Date
d02cfc9f8b Merge r1825120 from trunk:
* modules/ssl/ssl_engine_init.c (ssl_init_PushCAList): Remove function.
  (ssl_init_ca_cert_path): Use SSL_add_file_cert_subjects_to_stack()
  instead.

[Edit: This does change behaviour: the acceptable client CA list is now 
 always be sent in sorted order rather than configured/file order.
 In the case of SSLCACertificatePath and SSLCADNRequestPath, the
 order will be stable rather than non-determistic as previously.]

PR: 61574
Github: closes #406
Reviewed by: jorton, jfclere, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1915740 13f79535-47bb-0310-9956-ffa450edef68
2024-02-12 08:37:35 +00:00
4e29445936 Merge r1884552 from trunk:
Treat non-leaf certificates present in SSLProxyMachineCertificateFile
the same was as non-leaf certs are in SSLCertificateFile - use them to
build the trusted cert chain for the end-entity (client) cert.

* modules/ssl/ssl_engine_init.c (ssl_init_proxy_certs):
  For any non-leaf certificate present in the configured, trust as
  if used in SSLProxyMachineCertificateChainFile.

Github: closes #403
Reviewed by: jorton, gbechis, jfclere


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1915679 13f79535-47bb-0310-9956-ffa450edef68
2024-02-09 09:12:02 +00:00
e3ca3e4829 Merge r1874101, r1913838 from trunk:
fix build with LibreSSL 2.0.7+

PR: 64047

Follow up to r1874101: Axe useless LIBRESSL_VERSION_NUMBER check.

Since the fix to MODSSL_USE_OPENSSL_PRE_1_1_API in r1908537, we are sure that
  !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x2070000fL
in this block.

Submitted by: gbechis, ylavic
Reviewed by: ylavic, minfrin, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1915539 13f79535-47bb-0310-9956-ffa450edef68
2024-02-02 11:55:30 +00:00
28f6fc01c3 Backport to v2.4.
*) mod_ssl: Improve compatibility with OpenSSL 3, fix build warnings about
     deprecated ENGINE_ API, honor OPENSSL_API_COMPAT setting while defaulting
     to compatibitily with version 1.1.1 (including ENGINEs / SSLCryptoDevice).
     mod_ssl: Disable the OpenSSL ENGINE API when OPENSSL_NO_ENGINE is set.
     Allow for "SSLCryptoDevice builtin" if the ENGINE API is not available,
     notably with OpenSSL >= 3.  PR 68080.
     trunk patch: http://svn.apache.org/r1908537
                  http://svn.apache.org/r1908539
                  http://svn.apache.org/r1908542
                  http://svn.apache.org/r1913616
                  http://svn.apache.org/r1913815
                  http://svn.apache.org/r1913816
                  http://svn.apache.org/r1908542
                  http://svn.apache.org/r1913832
     2.4.x patch: https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/381.diff
                  (https://github.com/apache/httpd/pull/381)
     +1: ylavic, jorton, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1913912 13f79535-47bb-0310-9956-ffa450edef68
2023-11-18 11:34:12 +00:00
80560d29c8 Backport to v2.4:
*) mod_ssl: release memory to the OS when needed
     Trunk version of patch:
       https://svn.apache.org/r1898410
       https://svn.apache.org/r1898366
        svn merge -c 1898366 ^/httpd/httpd/trunk .
        svn merge -c 1898410 ^/httpd/httpd/trunk .
     +1: gbechis, ylavic, jorton



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1913909 13f79535-47bb-0310-9956-ffa450edef68
2023-11-18 11:20:14 +00:00
7564d3b124 Merge r1912015 from trunk:
mod_ssl: Silence info log message "SSL Library Error: error:0A000126:
         SSL routines::unexpected eof while reading" when using
         OpenSSL 3 by setting SSL_OP_IGNORE_UNEXPECTED_EOF if
         available. [Rainer Jung]

Reviewed by: rjung, gbechis, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1913012 13f79535-47bb-0310-9956-ffa450edef68
2023-10-16 11:48:06 +00:00
4d37880753 Merge r1822857, r1876815, r1893499, r1900024, r1900152, r1900306, r1900559, r1900564, r1900691, r1900694 from trunk:
* Makefile.in (build/config_vars.out): Rebuild if build/config_vars.sh
  has changed.


sort safe_env_lst 
bz 64371


mod_optional_hook_import: debug message at APLOG_DEBUG level.



  *) de-duplicate ALOGNO from code copy.



ab: apr_base64_encode already NUL-terminate the output.

And returns the length including the trailing \0, so setting it at that
length is off by +1.



* Avoid an overflow on large inputs

PR: 66033


dav_get_liveprop_info() returns a long not an int.

Update the type of global_ns accordingly and update the format specifier when this variable is used in printf like functions.

This also aligns code with dav_core_insert_prop() in modules/dav/main/std_liveprop.c

Length computed by count_string() are accumulated in an apr_size_t, so be more consistent and use this data type also in this function.

Fix some typo

[skip ci]

Fix some typos

[skip ci]
Submitted by: jorton, gbechis, ylavic, icing, ylavic, rpluem, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed by: jailletc36, rpluem, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1903618 13f79535-47bb-0310-9956-ffa450edef68
2022-08-21 20:26:51 +00:00
5129665ae9 Merge Pull 321 (trunk: r1874005, r1877261, r1901470):
*) mod_ssl: SSLFIPS compatible with OpenSSL 3.0.  PR 66063.
     [Petr Sumbera <petr.sumbera oracle.com>, Yann Ylavic]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1901586 13f79535-47bb-0310-9956-ffa450edef68
2022-06-03 08:27:07 +00:00
769bc2137a Backport.
*) mod_ssl: Updates to support OpenSSL 3.x
     trunk patch: https://svn.apache.org/r1519264
                  https://svn.apache.org/r1737657
                  https://svn.apache.org/r1876934
                  https://svn.apache.org/r1876936
                  https://svn.apache.org/r1876938
                  https://svn.apache.org/r1890067
                  https://svn.apache.org/r1890076
                  https://svn.apache.org/r1891138
                  https://svn.apache.org/r1893876
                  https://svn.apache.org/r1893964
                  https://svn.apache.org/r1894716
                  https://svn.apache.org/r1895774
     backport PR: https://github.com/apache/httpd/pull/258
     2.4.x patch: https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/258.patch
                  or https://people.apache.org/~jorton/mod_ssl-openssl3.patch
     +1: jorton, minfrin, ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895868 13f79535-47bb-0310-9956-ffa450edef68
2021-12-13 10:27:03 +00:00
9ecde98131 Revert r1895807 [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895808 13f79535-47bb-0310-9956-ffa450edef68
2021-12-11 12:57:53 +00:00
4e5ec8ef75 Vote, promote [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895807 13f79535-47bb-0310-9956-ffa450edef68
2021-12-11 12:56:14 +00:00
092dfece31 Merge r1869842 from trunk:
mod_ssl: Log private key material to file set by $SSLKEYLOGFILE in the
environment, using the standard format which can be parsed by (e.g.)
wireshark for decoding SSL/TLS traffic; supported from OpenSSL 1.1.1.

* modules/ssl/ssl_private.h: Add keylog_file to SSLModConfigRec.

* modules/ssl/ssl_engine_init.c (ssl_init_Module): Open log file if
  SSLKEYLOGFILE is set in the environment.
  (ssl_init_ctx_protocol): Register the keylog callback with OpenSSL.

* modules/ssl/ssl_engine_kernel.c (modssl_callback_keylog):
  New function.

PR: 63391
Github: closes #74


Submitted by: jorton
Reviewed by: rpluem, ylavic, jorton

Github: closes #264


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893099 13f79535-47bb-0310-9956-ffa450edef68
2021-09-08 06:55:40 +00:00
c0cff48bcc Merge of [r1886840, r1887085, r1887087, r1887134, r1887151, r1887152,
r1887337, r1887340, r1887342, r1887343, r1887360, r1887364, 
       r1887923, r1887965, r1887993, r1888006, r1888083, r1888084,
       r1888723, r1888724, r1888726, r1888729, r1889788] from trunk:

   *) core/mod_ssl/mod_md:
     - adding new ap_ssl_*() functions for a backward
       compatible replacement of the major optional mod_ssl functions. This
       allows other ssl modules to work without impersonating mod_ssl and
       also allows different ssl modules being active on separate ports.
     - latest mod_md with support for multiple certificates per domain
       and ECDSA certificates. Removed ACMEv1 support.
     - Interworking mod_md and ssl modules changed to exchange PEM strings
       instead of file paths for ACME challenges.
     - core/mod_ssl/mod_md: adding OCSP response provisioning as core feature.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1889793 13f79535-47bb-0310-9956-ffa450edef68
2021-05-12 10:14:42 +00:00
64143c9eb8 Backport to 2.4:
*) Easy patches: synch 2.4.x and trunk
        - mod_http2: Fix ascii art
        - mod_http2: fix some dox comments
        - mod_dav: Don't call memcpy(,NULL,0)
        - mod_ssl: Pass base_server in OpenSSL init log message
        - .gdbinit: tab to space
        - mod_so: don't try to load modules from a NULL path
        - mod_cache_file/mod_lua: Add missing "const" or "static const" qualifiers
                                  in some command_rec definitions
        - mod_lua: Fix compilation error if APR_HAS_THREADS is not defined
        - core/log: fix an harmless warning spoted by gcc 10
        - mod_ssl: update comment
     trunk patch:
          http://svn.apache.org/r1810233
          http://svn.apache.org/r1827530
          http://svn.apache.org/r1874144
          http://svn.apache.org/r1877262
          http://svn.apache.org/r1878263
          http://svn.apache.org/r1880461
          http://svn.apache.org/r1882053
          http://svn.apache.org/r1882060
          http://svn.apache.org/r1883452
          http://svn.apache.org/r1884551
     2.4.x patch: svn merge -c 1810233,1827530,1874144,1877262,1878263,1880461,1882053,1882060,1883452,1884551 ^/httpd/httpd/trunk .
     +1: jailletc36, jorton, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885612 13f79535-47bb-0310-9956-ffa450edef68
2021-01-17 17:23:37 +00:00
1d6cc695f2 Merge r1705539, r1877263, r1877291, r1879445 from trunk:
deduplicate the code handling the directory traversal for the
SSL[Proxy]CACertificatePath and SSLProxyMachineCertificatePath
directives


* modules/ssl/ssl_engine_init.c (ssl_add_version_components,
  ssl_init_Module): Use temporary pool for variable lookup results
  which don't need to live in pconf.


mod_ssl: Factor out code to read a BIO into a palloc'ed string:

* modules/ssl/ssl_util_ssl.c (modssl_bio_free_read): New function.
  (asn1_string_convert): Use it here.

* modules/ssl/ssl_engine_vars.c: Use it throughout.


* modules/ssl/ssl_scache.c (ssl_scache_init): Use <16 character
  cname argument for socache ->init() per the API constraint.

Submitted by: kbrand, jorton, jorton, jorton
Reviewed by: jailletc36, minfrin, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1879598 13f79535-47bb-0310-9956-ffa450edef68
2020-07-07 16:57:22 +00:00
aff62154bc Merge r1830819, r1830912, r1830913, r1830927, r1831168, r1831173, r1835240, r1835242, r1835615, r1836547 from trunk:
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.

* modules/ssl/ssl_util_ssl.c, modules/ssl/ssl_util_ssl.h:
  Remove modssl_read_encrypted_pkey() and helpers, added in r1804087
  but never used.

* modules/ssl/ssl_util_ssl.c (modssl_read_privatekey): Remove unused
  second argument.

* modules/ssl/ssl_engine_pphrase.c (ssl_load_encrypted_pkey): Adjust
  accordingly.

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.

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.


* modules/ssl/ssl_engine_init.c (ssl_init_server_certs): Add error
  logno. Free EVP_PKEY in engine case.  Never try reading ECDH/DH
  parameters from engine ids.

Hook up PKCS#11 PIN entry through configured passphrase entry method.

* modules/ssl/ssl_engine_pphrase.c: Add wrappers for OpenSSL UI * API
  around passphrase entry.
  (modssl_load_engine_keypair): Take vhost ID and use above rather than
  default OpenSSL UI.

* modules/ssl/ssl_engine_init.c (ssl_init_server_certs): Pass vhost ID.

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

* modules/ssl/ssl_engine_pphrase.c: Add logno tags.

* modules/ssl/ssl_engine_pphrase.c (modssl_load_engine_keypair): Load
  the engine associated with the private key (&cert) explicitly
  rather than requiring the engine to be set as the default method
  for all operations (with "SSLCryptoDevice <engine>").

(Thanks to Anderson Sasaki <ansasaki redhat.com> for suggested
improvement and guidance)

* modules/ssl/ssl_engine_pphrase.c: Fix linking against OpenSSL without
  ENGINE support.

Submitted by: Anderson Sasaki <ansasaki redhat.com>, jorton
Reviewed by: jorton, jim, ylavic
Github: closes #92


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1874196 13f79535-47bb-0310-9956-ffa450edef68
2020-02-19 13:32:50 +00:00
e0a4a2e331 Merge r1868645, r1868743, r1868929, r1868934, r1869077 from trunk:
mod_ssl: negotiate the TLS protocol version per name based vhost configuration.

By using the new ClientHello callback provided by OpenSSL 1.1.1, which runs at
the earliest connection stage, we can switch the SSL_CTX of the SSL connection
early enough for OpenSSL to take into account the protocol configuration of the
vhost.

In other words:
    SSL_set_SSL_CTX(c->SSL, s->SSL_CTX)
followed by:
    SSL_set_{min,max}_proto_version(SSL_CTX_get_{min,max}_proto_version(s->SSL_CTX))
works as expected at this stage (while the same from the SNI callback is
ignored by/due to OpenSSL's state machine).

Extracting the SNI (to select the relevant vhost) in the ClientHello callback
is not as easy as calling SSL_get_servername() though, we have to work with
the raw TLS extensions helpers provided by OpenSSL. I stole this code from a
test in the OpenSSL source code (i.e. client_hello_select_server_ctx() in
test/handshake_helper.c).

We can then call init_vhost() as with the SNI callback (in use only for OpenSSL
versions earlier than 1.1.1 now), and pass it the extracted SNI.


mod_ssl: follow up to r1868645.

Restore ssl_callback_ServerNameIndication() even with OpenSSL 1.1.1+, which
depends on its return value (OK/NOACK), mainly on session resumption, for
SSL_get_servername() to consider or ignore the SNI (returning NULL thus
making SSLStrictSNIVHostCheck fail for possibly legitimate cases).

This means that init_vhost() should accurately return whether the SNI exists
in the configured vhosts, even when it's called multiple times (e.g. first
from ClientHello callback and then from SNI callback), so save that state in
sslconn->vhost_found and reuse it.


mod_ssl: follow up to r1868645.

Keep the base server's SSLProtocol if none is configured on the vhost
selected by Hello/SNI callback.


mod_ssl: follow up to r1868645 and r1868929.

Merge ->protocol_set.


mod_ssl: follow up to r1868645.

CHANGES entry and docs' note.

Submitted by: ylavic
Reviewed by: ylavic, minfrin, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1873907 13f79535-47bb-0310-9956-ffa450edef68
2020-02-11 13:21:48 +00:00
636d6c0f30 Remove some trailing spaces that were merged in r1841573 in order to complete the corresponding backports and synch with trunk.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1869711 13f79535-47bb-0310-9956-ffa450edef68
2019-11-12 21:28:31 +00:00
8c670ccc1a Merged /httpd/httpd/trunk:r1864428 from trunk
*) mod_ssl: reverting a 2.4.40 change where a superfluous SSLCertificateChainFile configuration



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1864513 13f79535-47bb-0310-9956-ffa450edef68
2019-08-06 12:16:14 +00:00
734313ca6e Merged /httpd/httpd/trunk:r1851621,1852128,1862075
*) mod_ssl/mod_md: reversing dependency by letting mod_ssl offer hooks for
     adding certificates and keys to a virtual host. An additional hook allows
     answering special TLS connections as used in ACME challenges.
     Adding 2 new hooks for init/get of OCSP stapling status information when
     other modules want to provide those. Falls back to own implementation with
     same behaviour as before.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1863988 13f79535-47bb-0310-9956-ffa450edef68
2019-07-30 11:23:52 +00:00
fd5efd0b43 Merge of r1853133,r1853166 from trunk:
mod_ssl: Don't unset FIPS mode on restart unless it's forced by
     configuration (SSLFIPS on) and not active by default in OpenSSL. PR 63136.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1853197 13f79535-47bb-0310-9956-ffa450edef68
2019-02-08 09:01:42 +00:00
ae46c54ae7 Merge r1830816, r1830836, r1842882, r1842884 from trunk:
* modules/ssl: Add some missing logno tags.


* modules/ssl/ssl_engine_pphrase.c (ssl_load_encrypted_pkey):
  Simplify code, no functional change.


* modules/slotmem/mod_slotmem_shm.c (restore_slotmem): Remove
  redundant assignment (clang warning), the apr_file_eof(fp)=>APR_EOF
  case assigns rv to APR_EOF and then to APR_SUCCESS after already.


* modules/mappers/mod_negotiation.c (set_language_quality): Remove
  redundant branch (warning from Coverity).

Submitted by: jorton
Reviewed by: jailletc36, icing, jorton, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1848685 13f79535-47bb-0310-9956-ffa450edef68
2018-12-11 14:14:40 +00:00
aa34530365 mod_ssl: Fixes PR 62880 where certificate loading fails bc SSL ERRs are
not cleared beforehand.
+1: icing, jim, minfrin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1847280 13f79535-47bb-0310-9956-ffa450edef68
2018-11-23 14:57:22 +00:00
4658737147 Merge r1840710 from trunk:
* modules/ssl/ssl_engine_init.c (ssl_init_ctx_protocol):
  Disable AUTO_RETRY mode for OpenSSL 1.1.1, which fixes
  post-handshake authentication.
  (ssl_init_proxy_certs): Fix proxy client cert support with
  TLSv1.3, which is now crippled by default.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/tlsv1.3-for-2.4.x@1840711 13f79535-47bb-0310-9956-ffa450edef68
2018-09-12 15:54:59 +00:00
223f607038 On the tlsv1.3-for-2.4.x branch:
Merged 1827912,1827924,1827992,1828222,1828720,1828723,1833588,1833589,1839920,1839946 from trunk

  *) mod_ssl: add experimental support for TLSv1.3 (tested with OpenSSL v1.1.1-pre9. 
     SSL(Proxy)CipherSuite now has an optional first parameter for the protocol the ciphers are for.
     Directive "SSLVerifyClient" now triggers certificate retrieval from the client.
     Verifying the client fails exactly the same for HTTP/2 connections for all SSL protocols,
     as this would need to trigger the master connection thread - which we do not support
     right now.
     Renegotiation of ciphers is intentionally ignored for TLSv1.3 connections. "SSLCipherSuite"
     does not allow to specify TLSv1.3 ciphers in a directory context (because it cannot work) and
     TLSv1.2 or lower ciphers are not relevant for 1.3, as cipher suites are completely separate.
     Sites which make use of such TLSv1.2 feature need to evaluate carefully if or how they 
     can match their needs onto the TLSv1.3 protocol.
     [Yann Ylavic, Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/tlsv1.3-for-2.4.x@1840120 13f79535-47bb-0310-9956-ffa450edef68
2018-09-05 11:28:15 +00:00
fdb1526d60 mod_ssl: follow up to 2.4.x's r1666363.
Add missing bits from previous backport of r1666363.


Reviewed by: jailletc36, ylavic, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1835173 13f79535-47bb-0310-9956-ffa450edef68
2018-07-05 19:24:07 +00:00
dab6bb6373 Merge r1826995, r1827001 from trunk:
Extend SSLOCSPEnable with mode 'leaf' that only checks the leaf of a
certificate chain. PR62112 [Ricardo Martin Camarero <rickyepoderi yahoo.es>] 

Fixed OCSPEnable to keep accepting "off", not "none".

Submitted by: icing
Reviewedby: icing, ylavic, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1834089 13f79535-47bb-0310-9956-ffa450edef68
2018-06-22 09:45:39 +00:00
946f1e6b97 Merge r1829513 from trunk:
* modules/ssl/ssl_engine_init.c (ssl_init_Module): Don't enable SSL
  for a vhost if SSLEnable is not used and no certs are configured,
  even if the Listen protocol is "https".  Restores behaviour to that
  prior to r1809303 for configs which would now otherwise fail at
  startup.

Submitted by: jorton
Reviewed by: jorton, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1832495 13f79535-47bb-0310-9956-ffa450edef68
2018-05-29 21:27:15 +00:00
223df5cf69 mod_proxy, mod_ssl: Handle SSLProxy* directives in <Proxy> sections,
allowing per backend TLS configuration.
trunk patch: http://svn.apache.org/r1740928
             http://svn.apache.org/r1740960
             http://svn.apache.org/r1740967
             http://svn.apache.org/r1740987
             http://svn.apache.org/r1740998
             http://svn.apache.org/r1742697
             http://svn.apache.org/r1756976
             http://svn.apache.org/r1781313
             http://svn.apache.org/r1812193
2.4.x patch: https://svn.apache.org/repos/asf/httpd/httpd/patches/2.4.x/httpd-2.4.x-r1740928_and_co-v6.patch
+1: ylavic, icing, minfrin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1824187 13f79535-47bb-0310-9956-ffa450edef68
2018-02-13 23:43:36 +00:00
1de2691583 mod_md is backported in this branch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x-mod_md@1820579 13f79535-47bb-0310-9956-ffa450edef68
2018-01-08 15:58:57 +00:00
4c22188477 Sync with 2.4.x.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x-mod_md@1820360 13f79535-47bb-0310-9956-ffa450edef68
2018-01-05 22:04:52 +00:00
3ee19d0b50 On the 2.4.x-mod_md branch:
merged mod_md relevant parts of 1818030,1818120,1818308,1818725,1818792,1818849,1819799,1819854,1819943,1820036,1820310,1820312 from trunk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x-mod_md@1820314 13f79535-47bb-0310-9956-ffa450edef68
2018-01-05 15:34:15 +00:00
2b0f47eda5 On the 2.4.x branch:
merge of 1804530,1804531,1805186,1806939,1807232,1808122 from trunk.

Backport of mod_md support in mod_ssl.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1820075 13f79535-47bb-0310-9956-ffa450edef68
2018-01-04 12:15:42 +00:00
86c91e3266 Set of changes to bring mod_md into the 2.4.x branch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x-mod_md@1816423 13f79535-47bb-0310-9956-ffa450edef68
2017-11-27 10:44:56 +00:00
5d7c48237a Merge r1803392, r1803396, r1803398 from trunk:
mod_ssl: we can't use SSL_COMP_free_compression_methods() if OPENSSL_NO_COMP
is defined.  PR 61206.

Submitted by: Michael Schlenker <msc contact.de>


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


Follow up to r1803396: CHANGES entry.


Reviewed by: ylavic, jim, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1807734 13f79535-47bb-0310-9956-ffa450edef68
2017-09-08 12:20:16 +00:00
0fc9880259 Merge r1781575, r1781577, r1781580, r1781687, r1783305 from trunk:
Add Configuration for trusted OCSP responder certificates
Fix for PR 46037


Add back the file I removed in r1781575.


Add missing documentation for r1781575
Fix for PR 46037


Remove unused variable

Fix OpenSSL 1.1.0 breakage in r1781575; BIO_s_file_internal() is gone.



Submitted by: jfclere, druggeri, wrowe
Reviewed by: jfclere, jim, ylavic
Merge r1788430 from trunk:

mod_ssl: follow up to r1781575
Fix SSLOCSPNoVerify merging, and while at it capitalize Verify as suggested
by wrowe.


Submitted by: ylavic
Reviewed by: jfclere, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1789970 13f79535-47bb-0310-9956-ffa450edef68
2017-04-03 11:39:20 +00:00
ee0789f9b7 Merge r1781187, r1781190, r1781312 from trunk:
mod_ssl: work around leaks on (graceful) restart.

Tested with valgrind and --with-ssl shared/static.


mod_ssl: follow up to r1781187.
The ssl_util_thread_*() functions are not necessary with openssl-1.1+


mod_ssl: follow up to r1781187.
Address SSL_CTX leak in (merged) proxy_ctx.


Reviewed by: ylavic, jim, wrowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1788442 13f79535-47bb-0310-9956-ffa450edef68
2017-03-24 13:31:03 +00:00
d841beec31 Merge ^/httpd/httpd/branches/2.4.x-openssl-1.1.0-compat:
Support OpenSSL 1.1.0

Proposed by: rjung
Reviewed by: wrowe, jorton, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1787728 13f79535-47bb-0310-9956-ffa450edef68
2017-03-20 12:01:16 +00:00
4199cb4047 Merge r1756038 from trunk:
Fix spelling in comments and text files.
No functional change.
PR 59990

Submitted by: rjung
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1757669 13f79535-47bb-0310-9956-ffa450edef68
2016-08-25 12:48:18 +00:00
abc50f6d6c mod_ssl: Don't enable CRL checks/flags by default.
(follow up/fix to r1748338 committed in 2.4.21)

Submitted by: ylavic
Reviewed by: icing, minfrin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1748442 13f79535-47bb-0310-9956-ffa450edef68
2016-06-14 16:34:14 +00:00
7711282990 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.

Submitted by: ylavic
Reviewed by: icing, minfrin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1748338 13f79535-47bb-0310-9956-ffa450edef68
2016-06-13 23:48:39 +00:00
30deadd1bd Merge r1587607, r1588868 from trunk:
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.


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

Submitted by: trawick
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1735886 13f79535-47bb-0310-9956-ffa450edef68
2016-03-20 15:51:49 +00:00
c7459fa0d6 Merge r1720129, r1723295, r1733088, r1733089 from trunk:
* mod_ssl: Free dhparams when getting DH params. This fixes issue when
  SSLCryptoDevice does not get unregistered because of non-zero refcount
  during the mod_ssl unload happening on httpd startup.


mod_ssl: follow up to r1720129.
Free ecparams read from certificate file(s) on startup.

Follow up to r1720129 and r1723295: CHANGES entry.

Rephrase r1733088 since leaking means horrible things in cryptography.
This is not a security fix :p
Submitted by: jkaluza, ylavic, ylavic, ylavic
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1735770 13f79535-47bb-0310-9956-ffa450edef68
2016-03-19 13:26:25 +00:00
aded325d60 Add APLOGNO, first chunk (those that were
detected by coccinelle).

There are some more but they are easier to
backport once these here are applied.

Backport of r1725392, r1725394, r1725395
and r1725468 from trunk.

Submitted by: rjung
Reviewed by: jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1729495 13f79535-47bb-0310-9956-ffa450edef68
2016-02-09 23:09:24 +00:00
ecf6758840 merge r1703952 from trunk
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.

Proposed by: kbrand
Reviewed by: ylavic, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1706008 13f79535-47bb-0310-9956-ffa450edef68
2015-09-30 11:50:30 +00:00
181e083ddb merge r1702643 from trunk
Append :!aNULL:!eNULL:!EXP to the cipher string settings,
instead of prepending !aNULL:!eNULL:!EXP: (as was the case in 2.4.7
and later). Enables support for configuring the SUITEB* cipher
strings introduced in OpenSSL 1.0.2. PR 58213.

Apply the same treatment to the "SSLOpenSSLConfCmd CipherString ..." directive.

Proposed by: kbrand
Reviewed by: ylavic, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1706007 13f79535-47bb-0310-9956-ffa450edef68
2015-09-30 11:42:54 +00:00
b0dc766b75 merge r1674538, r1677143, r1677144, r1677145, r1677146, r1677149, r1677151,
r1677153, r1677154, r1677155, r1677156, r1677159, r1677830, r1677832,
r1677834, r1677835 from trunk

mod_ssl namespacing

Proposed by: kbrand
Reviewed by: ylavic, jorton


mod_ssl namespacing: Rename ssl_util_ssl.h macros from SSL_foo to MODSSL_foo.
For related discussion, see the dev@ thread starting at:
http://mail-archives.apache.org/mod_mbox/httpd-dev/201504.mbox/%3C20150415163613.GC15209%40fintan.stsp.name%3E

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.

mod_ssl namespacing: SSL_read_PrivateKey -> modssl_read_privatekey

mod_ssl namespacing: SSL_smart_shutdown -> modssl_smart_shutdown

mod_ssl namespacing: SSL_X509_getBC -> modssl_X509_getBC

mod_ssl namespacing: Make SSL_ASN1_STRING_to_utf8 a static function inside
ssl_util_ssl.c (no callers outside this file). The new static function name
chosen is convert_asn1_to_utf8, based on the assumption that neither SSL_
nor ASN1_ are safe prefixes to use without potential future overlap.

mod_ssl namespacing: Rename SSL_X509_NAME_ENTRY_to_string to
modssl_X509_NAME_ENTRY_to_string.

mod_ssl namespacing: SSL_X509_NAME_to_string -> modssl_X509_NAME_to_string

mod_ssl namespacing: SSL_X509_getSAN -> modssl_X509_getSAN

mod_ssl namespacing: Make SSL_X509_getIDs a static function inside the
file ssl_util_ssl.c (no outside callers). Rename to just getIDs().

mod_ssl namespacing: SSL_X509_match_name -> modssl_X509_match_name

mod_ssl namespacing: SSL_X509_INFO_load_file -> modssl_X509_INFO_load_file

mod_ssl namespacing: Merge SSL_X509_INFO_load_path() into its only caller
ssl_init_proxy_certs() in ssl_engine_init.c. No functional change.
Review by: kbrand

mod_ssl namespacing: Move modssl_X509_INFO_load_file() into ssl_engine_init.c
and make it a static function called load_x509_info().

mod_ssl namespacing: Move SSL_CTX_use_certificate_chain() into ssl_engine_init.c
and make it a static function called use_certificate_chain().

mod_ssl namespacing: Rename SSL_SESSION_id2sz() to modssl_SSL_SESSION_id2sz().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1706002 13f79535-47bb-0310-9956-ffa450edef68
2015-09-30 11:31:43 +00:00
7475aa0909 Merge r1697855, r1697339, r1696428, r1696266, r1696264, r1695874, r1695727, r1692516, r1692486, r1610674, r1685069, r1693918, r1698116, r1698133, r1694950, r1700968, r1701005, r1701145, r1701178 from trunk:
adding ap_get_protocol(c) which safeguards against NULL returns, for use instead of direct calling ap_run_protocol_get

changed Protocols to let vhosts override servers, removed old H2Engine example from readme

creating ap_array_index in util, forwarding scheme into request processing, enabling SSL vars only when scheme is not http:, delayed connection creation until task worker assignment

removed unnecessary lingering_close and sbh update on end of protocol upgrade handling

introducing ap_array_index in util, used in protocol and mod_h2

fixes existing protocol missing in selection if not explicitly proposed

new directive ProtocolsHonorOrder, added documentation for Protocols feature, changed preference selection and config merging

removed accidental code

new Protocols directive and core API changes to enable protocol switching on HTTP Upgrade or ALPN, implemented in mod_ssl and mod_h2

SECURITY (CVE-2014-0117): Fix a crash in mod_proxy.  In a reverse
proxy configuration, a remote attacker could send a carefully crafted
request which could crash a server process, resulting in denial of
service.

Thanks to Marek Kroemeke working with HP's Zero Day Initiative for
reporting this issue.

* server/util.c (ap_parse_token_list_strict): New function.

* modules/proxy/proxy_util.c (find_conn_headers): Use it here.

* modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response):
  Send a 400 for a malformed Connection header.

Submitted by: Edward Lu, breser, covener


http, mod_ssl: Introduce and return the 421 (Misdirected Request) status code
for clients requesting a hostname on a reused connection whose SNI (from the
TLS handshake) does not match.
PR 5802.

This allows HTTP/2 clients to fall back to a new connection as per:
https://tools.ietf.org/html/rfc7540#section-9.1.2

Proposed by: Stefan Eissing <stefan eissing.org>
Reviewed by: ylavic


c89


Allowing protocol_propose hooks to be called with offers=NULL, clarifying semantics as proposed by chaosed0@gmail.com

giving ap_array_index a start parameter, adding ap_array_contains

ap_process_request needs exportation for use in mod_h2 on Windows


final final change to the new ap_array_str_* functions after review

changed Protocols default to http/1.1 only, updated documentation, changed ap_select_protocol() to return NULL when no protocol could be agreed upon

mod_ssl: fix compiler warning (bad cast).

improvements in ap_select_protocol(), supplied by yann ylavic
Submitted by: icing, jorton, ylavic, covener, icing, icing, gsmith, icing, icing, ylavic, icing
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1705672 13f79535-47bb-0310-9956-ffa450edef68
2015-09-28 12:31:37 +00:00
fb5c0d5f14 mod_ssl: fix small memory leak in ssl_init_server_certs when ECDH is used.
SSL_CTX_set_tmp_ecdh increases reference count, so we have to call
EC_KEY_free, otherwise eckey will not be freed.

Backports: r1666363
Author: jkaluza
Reviewed by: rjung, ylavic, wrowe



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1682074 13f79535-47bb-0310-9956-ffa450edef68
2015-05-27 16:33:10 +00:00
8ad013bf7b Merge r1679470 from trunk:
mod_ssl: follow up to r1527291.
Always prepend "!aNULL:!eNULL:" to SSL_DEFAULT_CIPHER_LIST (default for
SSL[Proxy]CipherSuite) since we support OpenSSL versions where this was
not yet included by default.

Submitted by: ylavic
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1679989 13f79535-47bb-0310-9956-ffa450edef68
2015-05-18 11:07:07 +00:00