Skip to content

Commit

Permalink
compatible with the ssl old config enbale_http2
Browse files Browse the repository at this point in the history
Signed-off-by: wayne-cheng <zhengwei@tiduyun.com>
  • Loading branch information
wayne-cheng committed Aug 23, 2021
1 parent a26c8fc commit 8f69513
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apisix/cli/ops.lua
Original file line number Diff line number Diff line change
Expand Up @@ -539,17 +539,17 @@ Please modify "admin_key" in conf/config.yaml .
-- listen in https, support multiple ports, support specific IP
if type(yaml_conf.apisix.ssl.listen) == "number" then
listen_table_insert(ssl_listen, "https", "0.0.0.0", yaml_conf.apisix.ssl.listen,
false, yaml_conf.apisix.enable_ipv6)
yaml_conf.apisix.ssl.enable_http2, yaml_conf.apisix.enable_ipv6)
elseif type(yaml_conf.apisix.ssl.listen) == "table" then
for _, value in ipairs(yaml_conf.apisix.ssl.listen) do
if type(value) == "number" then
listen_table_insert(ssl_listen, "https", "0.0.0.0", value,
false, yaml_conf.apisix.enable_ipv6)
yaml_conf.apisix.ssl.enable_http2, yaml_conf.apisix.enable_ipv6)
elseif type(value) == "table" then
local ip = value.ip
local port = value.port
local enable_ipv6 = false
local enable_http2 = value.enable_http2
local enable_http2 = (value.enable_http2 or yaml_conf.apisix.ssl.enable_http2)

if ip == nil then
ip = "0.0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion conf/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ apisix:
# - ip: 127.0.0.3 # Specific IP, If not set, the default value is `0.0.0.0`.
# port: 9445
# enable_http2: true
enable_http2: true # Not recommend: This parameter should be set via the `listen`. It is only used for `listen_port`.
enable_http2: true # Not recommend: This parameter should be set via the `listen`.
# listen_port: 9443 # Not recommend: This parameter should be set via the `listen`.
#ssl_trusted_certificate: /path/to/ca-cert # Specifies a file path with trusted CA certificates in the PEM format
# used to verify the certificate when APISIX needs to do SSL/TLS handshaking
Expand Down
1 change: 1 addition & 0 deletions t/cli/test_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ apisix:
port: 9082
enable_http2: true
ssl:
enable_http2: false
listen:
- ip: 127.0.0.3
port: 9444
Expand Down

0 comments on commit 8f69513

Please sign in to comment.