From: Casey Bodley Date: Wed, 31 Oct 2018 18:19:48 +0000 (-0400) Subject: rgw: beast frontend uses default port 443 for ssl_endpoint X-Git-Tag: v12.2.11~77^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=16e33b4597a16eff2719d8f8344f95279d6e0882;p=ceph.git rgw: beast frontend uses default port 443 for ssl_endpoint Signed-off-by: Casey Bodley (cherry picked from commit 9836ee2643c38afcd0221488d607dffa359e9bd4) Conflicts: src/rgw/rgw_asio_frontend.cc - luminous uses different types for parse_endpoint arguments in function definition --- diff --git a/doc/radosgw/frontends.rst b/doc/radosgw/frontends.rst index 3170cc2493b3..7e45987815d4 100644 --- a/doc/radosgw/frontends.rst +++ b/doc/radosgw/frontends.rst @@ -32,8 +32,9 @@ Options :Description: Sets the listening address in the form ``address[:port]``, where the address is an IPv4 address string in dotted decimal form, or an IPv6 address in hexadecimal notation. The - optional port defaults to 80. Can be specified multiple times - as in ``endpoint=::1 endpoint=192.168.0.100:8000``. + optional port defaults to 80 for ``endpoint`` and 443 for + ``ssl_endpoint``. Can be specified multiple times as in + ``endpoint=::1 endpoint=192.168.0.100:8000``. :Type: Integer :Default: None diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc index bf5b6be0bde9..b52720f73778 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -257,6 +257,7 @@ unsigned short parse_port(const char *input, boost::system::error_code& ec) } tcp::endpoint parse_endpoint(BOOST_ASIO_STRING_VIEW_PARAM input, + unsigned short default_port, boost::system::error_code& ec) { tcp::endpoint endpoint; @@ -266,7 +267,7 @@ tcp::endpoint parse_endpoint(BOOST_ASIO_STRING_VIEW_PARAM input, auto port_str = input.substr(colon + 1); endpoint.port(parse_port(port_str.data(), ec)); } else { - endpoint.port(80); + endpoint.port(default_port); } if (!ec) { auto addr = input.substr(0, colon); @@ -324,7 +325,7 @@ int AsioFrontend::init() auto endpoints = config.equal_range("endpoint"); for (auto i = endpoints.first; i != endpoints.second; ++i) { - auto endpoint = parse_endpoint(i->second, ec); + auto endpoint = parse_endpoint(i->second, 80, ec); if (ec) { lderr(ctx()) << "failed to parse endpoint=" << i->second << dendl; return -ec.value(); @@ -427,7 +428,7 @@ int AsioFrontend::init_ssl() lderr(ctx()) << "no ssl_certificate configured for ssl_endpoint" << dendl; return -EINVAL; } - auto endpoint = parse_endpoint(i->second, ec); + auto endpoint = parse_endpoint(i->second, 443, ec); if (ec) { lderr(ctx()) << "failed to parse ssl_endpoint=" << i->second << dendl; return -ec.value();