1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-02 18:26:38 +03:00

373 Commits

Author SHA1 Message Date
63f48bb6f3 remove antiquated 'SSLEngine optional' TLS upgrade
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927037 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 11:55:00 +00:00
d76573e760 update SNI validation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927035 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 11:51:57 +00:00
543a0be880 mod_ssl: Revert r1868929 on trunk (only).
We discussed in 2019 that after 2.4.x's backport r1873907 we should apply
normal/usual merging for SSLProtocol in next versions (thus trunk first).
See: https://lists.apache.org/thread/76yh7j3fwj2tsmffsqcqpv4mcfph5vqx

Make this happen finally.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1921360 13f79535-47bb-0310-9956-ffa450edef68
2024-10-16 14:11:41 +00:00
e9915b2bdb mod_ssl: Add SSLClientHelloVars directive which exposes various
ClientHello properties in new SSL_CLIENTHELLO_* variables.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Fixup_vars): Add
  SSL_CLIENTHELLO_* vars.
  (copy_clienthello_vars): New function.
  (ssl_callback_ClientHello): Call it when needed.

* modules/ssl/ssl_engine_vars.c (ssl_var_lookup_ssl_clienthello): New
  function.
  (ssl_var_lookup_ssl): Call it for SSL_CLIENTHELLO_*.

* modules/ssl/ssl_private.h (modssl_clienthello_vars): Add type.
  (SSLConnRec): Add clienthello_vars pointer.

* modules/ssl/ssl_engine_config.c, modules/ssl/mod_ssl.c: Add handling
  of new SSLClientHelloVars directive.

Submitted by: Charles Smutz <csmutz gmail.com>
Github: closes #483


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1921074 13f79535-47bb-0310-9956-ffa450edef68
2024-10-01 16:09:11 +00:00
79990b070f mod_ssl: Add SSL_HANDSHAKE_RTT environment variable.
* modules/ssl/ssl_engine_vars.c (ssl_var_lookup_ssl): Support
  SSL_HANDSHAKE_RTT.  (ssl_var_lookup_ssl_handshake_rtt): New
  function.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Fixup_vars): Add
  SSL_HANDSHAKE_RTT.

Submitted by: csmutz
Github: closes #477


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1920297 13f79535-47bb-0310-9956-ffa450edef68
2024-08-30 15:36:29 +00:00
0cfc8c3134 mod_ssl: Let modssl_set_io_callbacks() whether which callback is needed.
* modules/ssl/ssl_private.h:
  Add conn_rec and server_rec args to modssl_set_io_callbacks().

* modules/ssl/ssl_engine_io.c(modssl_set_io_callbacks):
  Don't set modssl_io_cb for log levels below TRACE4.

* modules/ssl/ssl_engine_io.c(ssl_io_filter_init),
  modules/ssl/ssl_engine_kernel.c(ssl_find_vhost):
  Call modssl_set_io_callbacks() unconditionally.

* modules/ssl/ssl_engine_io.c(modssl_io_cb):
  While at it, (cmd & BIO_CB_WRITE) is enough to differentiate a
  write from read.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918883 13f79535-47bb-0310-9956-ffa450edef68
2024-07-03 15:06:32 +00:00
fae4895b8d add SSL_CTX_set_session_id_context(3) checks
bz #66226


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908971 13f79535-47bb-0310-9956-ffa450edef68
2023-04-04 21:34:57 +00:00
132d4ee48f check SSL_do_handshake(3) return value
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908964 13f79535-47bb-0310-9956-ffa450edef68
2023-04-04 16:46:05 +00:00
11284b9d3b SSL_do_handshake can fail with 0 or <0 status codes.
spotted and fixed by rpluem@


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908936 13f79535-47bb-0310-9956-ffa450edef68
2023-04-03 09:03:51 +00:00
f766a83553 check for more possible SSL failures
bz #66225


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908805 13f79535-47bb-0310-9956-ffa450edef68
2023-03-30 17:09:09 +00:00
1e06568a28 mod_ssl: Fix deprecation warnings with openssl-3.
* mod_ssl_openssl.h:
  Make it the first openssl to be included openssl header, selecting the
  OpenSSL api based on OPENSSL_API_COMPAT eventually.

* ssl_private.h;
  Define OPENSSL_API_COMPAT to version 1.1.1 (last one supporting EGINE_ API)
  before including mod_ssl_openssl.h to enable the ENGINE_ api (TODO: switch to
  new "providers" api before the ENGINE_ api is abandonned..).
  mod_ssl.h is now implicitely included from there.
  Fix preprocessor "#define FOO (COND)" to "#if COND #define FOO 1 #else #define FOO 0".
  Define MODSSL_HAVE_ENGINE_API iff OPENSSL_API_COMPAT < 3.0 (otherwise all the
  engine features are disabled, only "builtin" is accepted).
  Define HAVE_SRP iff OPENSSL_API_COMPAT < 3.0 (no replacement for this api
  above, so it might not be implemenentedain httpd anymore at some point..).
  Define X509_get_not{Before,After} if missing to the non deprecated version.
  New modssl_set_io_callbacks() to factorize compat code for io callbacks.
  ssl_dh_GetParamFromFile() becomes modssl_dh_from_file() for openssl < 3.0 and
  modssl_dh_pkey_from_file() for openssl >= 3.0.

* mod_ssl.c, mod_ssl_ct.c, ssl_util_stapling:
  Including "ssl_private.h" only is suited/enough now.
  
* mod_ssl_ct.c, ssl_ct_log_config:
  Use EVP api with openssl >= 3 instead of the deprecated SHA256 one.

* ssl_engine_config.c(ssl_cmd_SSLCryptoDevice):
  Disabled engines (besides NULL/"builtin"/NULL) unless MODSSL_HAVE_ENGINE_API.

* ssl_engine_init:
  New compat modssl_runtime_lib_version() to address deprecated SSLeay().
  ssl_init_Engine() does nothing unless MODSSL_HAVE_ENGINE_API.
  Simplify ssl_init_server_certs() (less #ifdef-ery) with scoped local vars.
  Compat loading DH parameters and EC curve from cert.

* ssl_engine_io.c, ssl_engine_kernel.c:
  Implement common modssl_set_io_callbacks() and use it.

* ssl_engine_pphrase(modssl_load_engine_keypair):
  Depend on MODSSL_HAVE_ENGINE_API, or return ENOTIMPL.

* ssl_util.c(modssl_is_engine_id):
  No engine supported unless MODSSL_HAVE_ENGINE_API.

* ssl_util_ssl.c(modssl_dh_pkey_from_file, modssl_ec_group_from_file):
  Compat with openssl >= 3.0.
  


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908537 13f79535-47bb-0310-9956-ffa450edef68
2023-03-19 21:30:47 +00:00
3067b17275 Add SSL_SHARED_CIPHER environment variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908132 13f79535-47bb-0310-9956-ffa450edef68
2023-03-06 17:46:04 +00:00
80a4538022 return early if X509_STORE_CTX_init fails
bz 65902


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898368 13f79535-47bb-0310-9956-ffa450edef68
2022-02-24 11:52:46 +00:00
a4f45f275b *) core/mod_proxy/mod_ssl:
Adding `outgoing` flag to conn_rec, indicating a connection is
     initiated by the server to somewhere, in contrast to incoming
     connections from clients.
     Adding 'ap_ssl_bind_outgoing()` function that marks a connection
     as outgoing and is used by mod_proxy instead of the previous
     optional function `ssl_engine_set`. This enables other SSL
     module to secure proxy connections.
     The optional functions `ssl_engine_set`, `ssl_engine_disable` and
     `ssl_proxy_enable` are now provided by the core to have backward
     compatibility with non-httpd modules that might use them. mod_ssl
     itself no longer registers these functions, but keeps them in its
     header for backward compatibility.
     The core provided optional function wrap any registered function
     like it was done for `ssl_is_ssl`.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1890605 13f79535-47bb-0310-9956-ffa450edef68
2021-06-08 14:37:44 +00:00
9ce47de74a mod_ssl: Switch to using OpenSSL's automatic internal DH parameter
generation from OpenSSL 1.1.0 and later.  The
SSL_set_tmp_dh_callback() API is deprecated from OpenSSL 3.0 onwards.
Should not be a user-visible change (except mod_ssl gets smaller).

* modules/ssl/ssl_private.h,
  modules/ssl/ssl_engine_kernel.c,
  modules/ssl/ssl_engine_init.c (ssl_init_ctx_callbacks):
  Drop internal DH parameter generation and callback for OpenSSL 1.1+,
  use SSL_CTX_set_dh_auto(, 1) instead.

Github: closes #188
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1890067 13f79535-47bb-0310-9956-ffa450edef68
2021-05-21 09:58:14 +00:00
8951949163 core/ap_ssl_*: changes after review by rpluem
- removed no longer needed (char*) casts when looking
   up ssl variables.
 - move 'goto cleanup;' on separate source line
 - fixed check for wrong optional function in ap_run_ssl_var_lookup
 - remove ap_bytes_t again from httpd.h and passes now ocsp
   identifier as separate const char* and apr_size_t. This
   follows more how such data is passed in the rest of the
   server.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1889009 13f79535-47bb-0310-9956-ffa450edef68
2021-04-20 12:16:05 +00:00
1c76cd3081 mod_ssl: Add base64-encoded DER certificate variables as alternative
to PEM, to avoid newline mangling issues when using PEM in header
values.

* modules/ssl/ssl_private.h (SSL_OPT_EXPORTCB64DATA): New constant.

* modules/ssl/ssl_engine_vars.c (ssl_var_lookup_ssl_cert_data):
  New function, replacing ssl_var_lookup_ssl_cert_PEM.
  (ssl_var_lookup_ssl): Use it, and add _B64CERT variants of
  SSL_{CLIENT,SERVER}_CERT.
  (ssl_var_lookup_ssl_cert_chain): Use it.
  
* modules/ssl/ssl_engine_config.c (ssl_cmd_SSLOptions): Support
  "ExportBase64CertData" argument.

* modules/ssl/ssl_engine_kernel.c (extract_to_env): New function.
  (ssl_hook_Fixup): Use it, also export _B64CERT variables if
  SSL_OPT_EXPORTCB64DATA is set; simplify the client cert chain
  handling.

PR: 65169
Reviewed by: michaelo
Github: closes #177


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887811 13f79535-47bb-0310-9956-ffa450edef68
2021-03-19 15:15:36 +00:00
899096a066 And the necessary log tags added just shortly afterwards.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887152 13f79535-47bb-0310-9956-ffa450edef68
2021-03-03 15:52:56 +00:00
6951408220 Changed ap_ssl_answer_challenge() and its hook to provide PEM data for
certificate and key instead of file names.

Added support for this in mod_ssl and verified with a local mod_md 
version that uses it.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887151 13f79535-47bb-0310-9956-ffa450edef68
2021-03-03 15:52:18 +00:00
083b4b1b60 Fixed regression in r1887085 where a SSL function was used that is not available in OpenSSL 1.0.2.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887134 13f79535-47bb-0310-9956-ffa450edef68
2021-03-03 08:55:23 +00:00
cd1fa489d2 Adding log tags where log tags are needed.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887087 13f79535-47bb-0310-9956-ffa450edef68
2021-03-02 14:52:56 +00:00
5dc01860db Adding more ap_ssl_* functions and hooks to the core server.
- ap_ssl_add_cert_files() to enable other modules like mod_md to provide
       certificate and keys for an SSL module like mod_ssl.
     - ap_ssl_add_fallback_cert_files() to enable other modules like mod_md to
       provide a fallback certificate in case no 'proper' certificate is
       available for an SSL module like mod_ssl.
     - ap_ssl_answer_challenge() to enable other modules like mod_md to
       provide a certificate as used in the RFC 8555 'tls-alpn-01' challenge
       for the ACME protocol for an SSL module like mod_ssl.
    - Hooks for 'ssl_add_cert_files', 'ssl_add_fallback_cert_files' and
      'ssl_answer_challenge' where modules like mod_md can provide providers
      to the above mentioned functions.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887085 13f79535-47bb-0310-9956-ffa450edef68
2021-03-02 14:21:18 +00:00
28602f2509 * modules/ssl/ssl_engine_kernel.c (ssl_hook_Access_modern): Move
fill_reneg_buffer() call down after r->connection->master
  check.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1880927 13f79535-47bb-0310-9956-ffa450edef68
2020-08-17 12:32:19 +00:00
f8efcb67a4 mod_ssl: follow up to r1877397: fix SSL_OP_NO_RENEGOT*I*ATION typo.
Should work better now :)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877795 13f79535-47bb-0310-9956-ffa450edef68
2020-05-15 21:14:36 +00:00
b77cd8dfde mod_ssl: Update the ssl_var_lookup() API:
a) constify return value and variable name passed-in
b) require that pool argument is non-NULL
c) add gcc warning attributes for NULL arguments or ignored result.

This allows removal of inefficient internal duplication of constant
strings which was necessary only to allow non-const char *, and
removal of unsafe casts to/from const in various places.

* modules/ssl/ssl_engine_vars.c (ssl_var_lookup): Assume pool is
  non-NULL; return constant and remove apr_pstrdup of constant
  result string.  Also constify variable name.
  (ssl_var_lookup_*): Update to return const char * and avoid
  duplication where now possible.

* modules/ssl/mod_ssl.h: Update ssl_var_lookup() optional function
  API description and add GCC warning attributes as per private API.

* modules/ssl/ssl_engine_init.c (ssl_add_version_components): Adjust
  for const return value.

* modules/ssl/ssl_engine_io.c (ssl_io_filter_handshake): Pass c->pool
  to ssl_var_lookup.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Pass r->pool to
  ssl_var_lookup, expect const return and dup the string since r->user
  is char *.
  (log_tracing_state): Pass c->pool to ssl_var_lookup.

* modules/http2/h2_h2.c (h2_is_acceptable_connection): Assume
  return value of ssl_var_lookup is const.

Github: closes #120


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877475 13f79535-47bb-0310-9956-ffa450edef68
2020-05-07 15:34:04 +00:00
b8155f30da mod_ssl: Switch to using SSL_OP_NO_RENEGOTATION (where available) to
block client-initiated renegotiation with TLSv1.2 and earlier.

* modules/ssl/ssl_private.h: Define modssl_reneg_state enum,
  modssl_set_reneg_state function.

* modules/ssl/ssl_engine_io.c (bio_filter_out_write,
  bio_filter_in_read): #ifdef-out reneg protection if
  SSL_OP_NO_RENEGOTATION is defined.

* modules/ssl/ssl_engine_init.c (ssl_init_ctx_protocol):
  Enable SSL_OP_NO_RENEGOTATION.
  (ssl_init_ctx_callbacks): Only enable the "info" callback if
  debug-level logging *or* OpenSSL doesn't support SSL_OP_NO_RENEGOTATION.
  
* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access_classic): Use
  modssl_set_reneg_state to set the reneg protection mode.
  (ssl_hook_Access_modern): Drop manipulation of the reneg mode which
  does nothing for TLSv1.3 already.
  (ssl_callback_Info): Only enable reneg protection if
  SSL_OP_NO_RENEGOTATION is *not* defined.

* modules/ssl/ssl_util_ssl.c (modssl_set_reneg_state): New function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877397 13f79535-47bb-0310-9956-ffa450edef68
2020-05-05 12:40:38 +00:00
ccc38eab46 mod_ssl: Calculate the MD5 digest used as the session context once per
vhost at startup, rather than building it for each new connection.

* modules/ssl/ssl_private.h (struct SSLSrvConfigRec):
  Replace vhost_id_len field with vhost_md5.

* modules/ssl/ssl_engine_init.c (ssl_init_Module): Build the
  sc->vhost_md5 hash here.  
   
* modules/ssl/mod_ssl.c: Fail at compile time if the
  SSL_set_session_id_context() API constraint on context length is
  violated.
  (ssl_init_ssl_connection): Use sc->vhost_md5.

* modules/ssl/ssl_engine_kernel.c (ssl_find_vhost): Use sc->vhost_md5
  after renegotiation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877349 13f79535-47bb-0310-9956-ffa450edef68
2020-05-04 09:23:03 +00:00
87959528ce Prior to r1877345 mc->pPool was the process pool (s->process->pool).
Drop the field from SSLModConfigRec and use pconf instead (where
appropriate) to match the new SSLModConfigRec lifetime.

* modules/ssl/ssl_engine_kernel.c (ssl_callback_DelSessionCacheEntry):
  Explicitly (and probably unsafely) use the process pool.

* modules/ssl/ssl_engine_config.c (ssl_cmd_SSLRandomSeed): Use
  cmd->pool to allocate paths.

* modules/ssl/ssl_engine_init.c (ssl_init_Module): Use pconf
  to allocate the keylog_file.
  
* modules/ssl/ssl_engine_vars.c (ssl_var_lookup): Drop lookup
  of SSLModConfigRec and use s->process->pool when no pool is
  passed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877347 13f79535-47bb-0310-9956-ffa450edef68
2020-05-04 08:58:02 +00:00
316aea784d mod_ssl: add compatibility with OpenSSL 3.0.0
Wrappers around deprecated API:
* X509_STORE_load_locations() => modssl_X509_STORE_load_locations(),
* CTX_load_verify_locations() => modssl_CTX_load_verify_locations(),
* ERR_peek_error_line_data()  => modssl_ERR_peek_error_data(),
* DH_bits(dh)                 => BN_num_bits(DH_get0_p(dh)).

Provide a compatible version of ssl_callback_SessionTicket() which does not
use the deprecated HMAC_CTX and HMAC_Init_ex(), replaced by EVP_MAC_CTX and
EVP_MAC_CTX_set_params() respectively. This requires adapting struct
modssl_ticket_key_t to replace hmac_secret[] with OSSL_PARAM mac_params[],
created once at load time still.
The callback is registered by SSL_CTX_set_tlsext_ticket_key_evp_cb() instead
of SSL_CTX_set_tlsext_ticket_key_cb().

Since BIO_eof() may now be called openssl-3 state machine, the never-called
assertion in bio_filter_in_ctrl() does not hold anymore, and we have to
handle BIO_CTRL_EOF. For any other cmd, we continue to AP_DEBUG_ASSERT(0) and
log an error, yet the return value is changed from -1 to 0 which is the usual
unhandled value.

Note that OpenSSL 3.0.0 is still in alpha stage as of now, the API shouldn't
change though, neither breakage to 1.x.x API.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876934 13f79535-47bb-0310-9956-ffa450edef68
2020-04-24 16:09:02 +00:00
837428cafe mod_ssl: axe useless X509_free (NULL arg).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876719 13f79535-47bb-0310-9956-ffa450edef68
2020-04-19 10:32:16 +00:00
11d565c3ce * modules/ssl/ssl_private.h: Define X509_up_ref and EVP_PKEY_up_ref
for OpenSSL < 1.1.

* modules/ssl/ssl_engine_kernel.c (modssl_set_cert_info):
* modules/ssl/ssl_util_stapling.c (stapling_get_issuer): 
  Use the above macros for all OpenSSL versions.

Github: closes #104


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1875702 13f79535-47bb-0310-9956-ffa450edef68
2020-03-26 11:03:54 +00:00
40d37b8a30 Fix compilation breakage with OpenSSL 1.1.0 up to 1.1.0f.
SSL_CTX_get_min_proto_version() and
SSL_CTX_get_max_proto_version() were only introduced in
1.1.0g.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1875544 13f79535-47bb-0310-9956-ffa450edef68
2020-03-23 13:33:22 +00:00
e820d1ea4d *) mod_ssl: Disable client verification on ACME ALPN challenges. Fixes github
issue mod_md#172 (https://github.com/icing/mod_md/issues/172).
     [Michael Kaufmann <mail michael-kaufmann.ch>, Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873888 13f79535-47bb-0310-9956-ffa450edef68
2020-02-11 10:13:24 +00:00
55239ec1e2 Add logno.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1870097 13f79535-47bb-0310-9956-ffa450edef68
2019-11-21 16:55:14 +00:00
3b6181a317 Buffer HTTP request bodies for TLSv1.3 PHA in the same way as for
TLSv<1.3 renegotiation.

* modules/ssl/ssl_engine_kernel.c (fill_reneg_buffer): Factor
  out...
  (ssl_hook_Access_classic): ... from here.
  (ssl_hook_Access_modern): Use it here too.

Github: closes #75


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1870095 13f79535-47bb-0310-9956-ffa450edef68
2019-11-21 15:51:32 +00:00
abe9502d3b 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1869842 13f79535-47bb-0310-9956-ffa450edef68
2019-11-15 09:46:30 +00:00
ce68ba8b33 mod_ssl: follow up to r1868645.
Keep the base server's SSLProtocol if none is configured on the vhost
selected by Hello/SNI callback.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1868929 13f79535-47bb-0310-9956-ffa450edef68
2019-10-25 13:26:14 +00:00
b3fb2d3972 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1868743 13f79535-47bb-0310-9956-ffa450edef68
2019-10-22 10:14:53 +00:00
076e28399c 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1868645 13f79535-47bb-0310-9956-ffa450edef68
2019-10-20 10:50:33 +00:00
b2c35e9360 mod_ssl: OCSP does not apply to proxy mode, fix verify context.
Since ssl_callback_SSLVerify() is called for both server and proxy modes,
use myCtxConfig()->ocsp_mask to check the right mode/configuration (i.e.
none for proxy in any case).

PR 63679.
Submitted by: Lubos Uhliarik <luhliari redhat.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1865740 13f79535-47bb-0310-9956-ffa450edef68
2019-08-23 10:31:01 +00:00
67ef6b9417 * modules/ssl/ssl_engine_kernel.c (ssl_hook_Access_modern): Correctly
restore SSL verify state after PHA failure in TLSv1.3.

Submitted by: Michael Kaufmann <mail michael-kaufmann.ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1855849 13f79535-47bb-0310-9956-ffa450edef68
2019-03-19 17:26:38 +00:00
03c5267908 mod_ssl: AH10129 from ERR to DEBUG level.
No error here, just debug information.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1855349 13f79535-47bb-0310-9956-ffa450edef68
2019-03-12 21:48:19 +00:00
d0b2560268 mod_ssl: give mod_md the chance to override certificate after ALPN protocol negotiation.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1852128 13f79535-47bb-0310-9956-ffa450edef68
2019-01-25 13:33:07 +00:00
4af9b5c071 reverting last change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1852037 13f79535-47bb-0310-9956-ffa450edef68
2019-01-24 15:21:04 +00:00
55fa049b9d mod_http2: enable re-use of slave connections again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1852032 13f79535-47bb-0310-9956-ffa450edef68
2019-01-24 15:10:34 +00:00
fe55941af9 *) mod_ssl: Fix mod_authz provider for "require ssl" directive to check correctly
on HTTP/2 connections. Fixes PR 62654. [Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1846111 13f79535-47bb-0310-9956-ffa450edef68
2018-11-08 10:09:21 +00:00
8280486c73 rollback 1844001.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1844090 13f79535-47bb-0310-9956-ffa450edef68
2018-10-17 12:48:18 +00:00
bbdbf79438 And a way to custom modules to guess and extract ssl variable.
See https://github.com/jfclere/JBCSP-17 for example...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1844001 13f79535-47bb-0310-9956-ffa450edef68
2018-10-16 12:53:18 +00:00
3e754d68fd * Pickup the proxy related configuration for verify mode and verify depth and
not the configuration settings for frontend connections in case of
  connections by the proxy to the backend.

PR: 62769


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1842540 13f79535-47bb-0310-9956-ffa450edef68
2018-10-01 18:21:18 +00:00
5a73b50ce6 On the trunk:
mod_ssl: changing from APLOG_WARN to DEBUG to INFO after review.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1841455 13f79535-47bb-0310-9956-ffa450edef68
2018-09-20 09:56:01 +00:00