From 9836ee2643c38afcd0221488d607dffa359e9bd4 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 31 Oct 2018 14:19:48 -0400 Subject: [PATCH] rgw: beast frontend uses default port 443 for ssl_endpoint Signed-off-by: Casey Bodley --- doc/radosgw/frontends.rst | 5 +++-- src/rgw/rgw_asio_frontend.cc | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/radosgw/frontends.rst b/doc/radosgw/frontends.rst index 90b9d8c6b72..742431e6f74 100644 --- a/doc/radosgw/frontends.rst +++ b/doc/radosgw/frontends.rst @@ -34,8 +34,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 6675448cb59..e687da00e5a 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -277,6 +277,7 @@ unsigned short parse_port(const char *input, boost::system::error_code& ec) } tcp::endpoint parse_endpoint(boost::asio::string_view input, + unsigned short default_port, boost::system::error_code& ec) { tcp::endpoint endpoint; @@ -286,7 +287,7 @@ tcp::endpoint parse_endpoint(boost::asio::string_view 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); @@ -344,7 +345,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(); @@ -447,7 +448,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(); -- 2.39.5