feat(stream): allow to set trust certificate (#4651)

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
This commit is contained in:
罗泽轩 2021-07-23 04:09:58 +08:00 committed by GitHub
parent f406218c0a
commit 149b53ed5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -73,6 +73,10 @@ stream {
resolver {% for _, dns_addr in ipairs(dns_resolver or {}) do %} {*dns_addr*} {% end %} {% if dns_resolver_valid then %} valid={*dns_resolver_valid*}{% end %};
resolver_timeout {*resolver_timeout*};
{% if ssl.ssl_trusted_certificate ~= nil then %}
lua_ssl_trusted_certificate {* ssl.ssl_trusted_certificate *};
{% end %}
# stream configuration snippet starts
{% if stream_configuration_snippet then %}
{* stream_configuration_snippet *}

View File

@ -53,3 +53,21 @@ if [ "$count" -ne 2 ]; then
fi
echo "passed: enable stream proxy and http proxy"
echo "
apisix:
ssl:
ssl_trusted_certificate: t/certs/mtls_ca.crt
stream_proxy:
tcp:
- addr: 9100
" > conf/config.yaml
make init
if ! grep "t/certs/mtls_ca.crt;" conf/nginx.conf > /dev/null; then
echo "failed: failed to set trust certificate"
exit 1
fi
echo "passed: set trust certificate"