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
9359e20667 On the trunk:
downgrade mod_ssl log level for requests not carrying SNI when SSLStrictSNIVHostCheck is on.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1841446 13f79535-47bb-0310-9956-ffa450edef68
2018-09-20 09:04:14 +00:00
20e049ab49 * modules/ssl/ssl_engine_kernel.c (ssl_check_post_client_verify):
Retrieve and set sslconn->client_cert here for both "modern" and
  classic access control.
  (ssl_hook_Access_classic, ssl_hook_Access_modern, ssl_hook_Access):
  Restore SSLRequire and FakeBasicAuth checks to ssl_hook_Access so tests
  are still applied for TLSv1.3.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1841218 13f79535-47bb-0310-9956-ffa450edef68
2018-09-18 11:05:43 +00:00
50f39b07dc * modules/ssl/ssl_engine_kernel.c (ssl_hook_Access_modern): Fail with
403 if SSL_verify_client_post_handshake() fails, e.g. when the
  TLS/1.3 client didn't send the Post-Handshake Authentication
  extension.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1840585 13f79535-47bb-0310-9956-ffa450edef68
2018-09-11 16:01:47 +00:00
6d730fb7ed mod_ssl: use SSL_HAVE_PROTOCOL_TLSV1_3 to check for compiled in TLS 1.3.
More meaningful than SSL_OP_NO_TLSv1_3, hopefully...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1833589 13f79535-47bb-0310-9956-ffa450edef68
2018-06-15 11:25:46 +00:00
35ca22d231 mod_ssl: disable check for client initiated renegotiations with TLS 1.3.
This is already forbidden by the protocol, enforced by OpenSSL, and the
current logic can't work (ssl_callback_Info() may be called multiple times
with TLS 1.3).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1833588 13f79535-47bb-0310-9956-ffa450edef68
2018-06-15 11:12:19 +00:00
4ab3d31543 I don't know if 'c' can be NULL here, but we should not dereference it before checking.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1831591 13f79535-47bb-0310-9956-ffa450edef68
2018-05-14 20:51:31 +00:00
7603230ed1 * modules/ssl: Add some missing logno tags.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1830816 13f79535-47bb-0310-9956-ffa450edef68
2018-05-03 12:25:32 +00:00
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
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
0dc4c7da73 We need to get the SSL_CTX for further processing down below.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828793 13f79535-47bb-0310-9956-ffa450edef68
2018-04-10 07:09:20 +00:00
e2b5f7ba0a * Fix copy and paste typo.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828792 13f79535-47bb-0310-9956-ffa450edef68
2018-04-10 06:42:39 +00:00
8860bd0ed8 * The sslconn parameter is not used.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828791 13f79535-47bb-0310-9956-ffa450edef68
2018-04-10 06:40:55 +00:00
d22291355d * Whitespace fixes. No functional change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828790 13f79535-47bb-0310-9956-ffa450edef68
2018-04-10 06:39:31 +00:00
83a4cb9a78 On the trunk:
Fix buildbot unused vars errors introduced by last checkin.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828723 13f79535-47bb-0310-9956-ffa450edef68
2018-04-09 14:13:30 +00:00
56e6ddba16 On the trunk:
SSLVerifyClient support for TLSv1.3 protocol now fails similarly to TLSv1.2 in my setups. (Read: I cannot get client certs to work, but I think this change is an improvement)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828720 13f79535-47bb-0310-9956-ffa450edef68
2018-04-09 14:05:42 +00:00
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
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
e94ac9326f Use 'ap_log_rerror()' instead of 'ap_log_error()' consistently
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827865 13f79535-47bb-0310-9956-ffa450edef68
2018-03-27 20:17:24 +00:00
e203d68bc4 Use 'ap_request_has_body()' instead of duplicating its implemenation.
The logic in 'ap_request_has_body()' is:
    has_body = (!r->header_only
                && (r->kept_body
                    || apr_table_get(r->headers_in, "Transfer-Encoding")
                    || ( (cls = apr_table_get(r->headers_in, "Content-Length"))
                        && (apr_strtoff(&cl, cls, &estr, 10) == APR_SUCCESS)
                        && (!*estr)
                        && (cl > 0) )
                    )
                );
So the test is slighly different from the original code. (but this looks fine to me)

This also has the advantage to avoid a redundant call to 'apr_table_get()' and to improve readability.

While at it, move the test '!r->expecting_100' a few lines above because it is cheap.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827374 13f79535-47bb-0310-9956-ffa450edef68
2018-03-20 23:05:54 +00:00
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
0b9b299354 * modules/ssl/ssl_engine_kernel.c (ssl_hook_UserCheck): Check username
does not contain a colon before constructing Authorization header
  for FakeBasicAuth mode. (Also constify 'user' variable.)

PR: 52644


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1815592 13f79535-47bb-0310-9956-ffa450edef68
2017-11-17 17:14:32 +00:00
b14a732d6f Fix typo in log message.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805163 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 09:50:39 +00:00
a68a39d321 log tags for mod_ssl changes and new mod_md
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1804531 13f79535-47bb-0310-9956-ffa450edef68
2017-08-09 13:59:26 +00:00
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
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
b70d7ae5b5 * modules/ssl/ssl_engine_kernel.c (ssl_callback_SessionTicket): Fail
if RAND_bytes() fails; possible per API, although not in practice
  with the OpenSSL implementation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757147 13f79535-47bb-0310-9956-ffa450edef68
2016-08-22 11:10:58 +00:00
a0cddc57d4 mod_ssl: Fix quick renegotiation (OptRenegotiaton) with no intermediate
in the client certificate chain.  PR 55786.

This is done by handling an empty cert chain as no/NULL chain.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756542 13f79535-47bb-0310-9956-ffa450edef68
2016-08-16 18:24:56 +00:00
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
a6517fdf5e Silence more "defined but not used" compiler
warnings when building against OpenSSL 0.9.8a.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755881 13f79535-47bb-0310-9956-ffa450edef68
2016-08-10 21:57:14 +00:00
83ed3dff9f Silence "defined but not used" compiler warnings
when building against OpenSSL 0.9.8a.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755874 13f79535-47bb-0310-9956-ffa450edef68
2016-08-10 21:34:21 +00:00
22204edc7a modssl: reset client-verify state when renegotiation is aborted
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750779 13f79535-47bb-0310-9956-ffa450edef68
2016-06-30 12:08:42 +00:00
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
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
1a829ed2fa mod_ssl: follow up to r1734561 and r1735337.
We also need to reset the X509_STORE_CTX's error in the callback to quiet
X509_V_ERR_UNABLE_TO_GET_CRL for the leaf certificate (caught by AH02010).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1737265 13f79535-47bb-0310-9956-ffa450edef68
2016-03-31 18:24:06 +00:00
4015277a9a mod_ssl: return non ambiguous value in ssl_callback_SessionTicket() for
encryption mode (we used to return 0, OpenSSL documents returning 1 instead).

Practically this does not change anything since OpenSSL will only check for
>= 0 return value (non error) for encryption mode (the other possible return
values are only relevant for decryption mode).

However the OpenSSL documentation for SSL_CTX_set_tlsext_ticket_key_cb()
states:
"
The return value of the cb function is used by OpenSSL to determine what
further processing will occur. The following return values have meaning:

2
    This indicates that the ctx and hctx have been set and the session can
    continue on those parameters. Additionally it indicates that the session
    ticket is in a renewal period and should be replaced. The OpenSSL library
    will call cb again with an enc argument of 1 to set the new ticket (see
    RFC5077 3.3 paragraph 2).

1
    This indicates that the ctx and hctx have been set and the session can
    continue on those parameters.

0
    This indicates that it was not possible to set/retrieve a session ticket
    and the SSL/TLS session will continue by by negotiating a set of
    cryptographic parameters or using the alternate SSL/TLS resumption
    mechanism, session ids.
    If called with enc equal to 0 the library will call the cb again to get a
    new set of parameters.

less than 0
    This indicates an error.
"

So 0 is not appropriate in our code, 1 is what we really want (and it won't
break if OpenSSL later changes its checks on the callback return value).

Reported/Proposed by: oknet on github, pull request #18.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1736186 13f79535-47bb-0310-9956-ffa450edef68
2016-03-22 13:09:17 +00:00
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
f048635f6f Support for OpenSSL 1.1.0:
- SRP_VBASE_get_by_user() is deprecated now,
  one should use SRP_VBASE_get1_by_user()
  instead. The new function returns a pointer
  owned by the callee. It must be freed after
  use.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735877 13f79535-47bb-0310-9956-ffa450edef68
2016-03-20 13:21:46 +00:00
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
45d8a4c9c0 mod_ssl: follow up to r1734561.
Use the right crl_check_flags in ssl_callback_SSLVerify(), can be either
a client or proxy connection here.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735159 13f79535-47bb-0310-9956-ffa450edef68
2016-03-15 19:13:36 +00:00
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
8eb3099574 Support for OpenSSL 1.1.0
- Simplify code by using new 1.1.0 variant
  also for older OpenSSL. Also tested with
  1.0.2f and 0.9.8zh. No ssl test suite
  failures.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1731423 13f79535-47bb-0310-9956-ffa450edef68
2016-02-20 16:46:38 +00:00
dc221e7adc Support for OpenSSL 1.1.0:
- 1.1.0-pre3 was relesed
  - remove pre2 comments which no longer apply
  - one more struct has been made opaque, use
    accessor function instead


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1731012 13f79535-47bb-0310-9956-ffa450edef68
2016-02-18 07:44:16 +00:00
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
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
434a3b9717 Support for OpenSSL 1.1.0:
- Fix typo in loop end condition

This code will be removed next. Thex fix is
for the case we want to roll teh code back
to this state.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730314 13f79535-47bb-0310-9956-ffa450edef68
2016-02-14 11:16:18 +00:00
35c192e868 Support OpenSSL 1.1.0:
- Fix renegotiation for the client side
  of a proxy connection.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730146 13f79535-47bb-0310-9956-ffa450edef68
2016-02-13 01:52:31 +00:00
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
9d0cc0b345 Support for OpenSSL 1.1.0:
- fix rejecting client initiated renegotiations


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729968 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 10:03:48 +00:00
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
4019a9f3d2 tune from rocky horror picture show: Doing the handshake...again
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729581 13f79535-47bb-0310-9956-ffa450edef68
2016-02-10 11:04:03 +00:00