]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: beast frontend uses default port 443 for ssl_endpoint
authorCasey Bodley <cbodley@redhat.com>
Wed, 31 Oct 2018 18:19:48 +0000 (14:19 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 12 Dec 2018 20:13:20 +0000 (21:13 +0100)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 9836ee2643c38afcd0221488d607dffa359e9bd4)

Conflicts:
src/rgw/rgw_asio_frontend.cc
- luminous uses different types for parse_endpoint arguments in function
  definition

doc/radosgw/frontends.rst
src/rgw/rgw_asio_frontend.cc

index 3170cc2493b35bea5f59bca8069ef8418fbe02b0..7e45987815d4854e7c239be2f7d55218e9151f8e 100644 (file)
@@ -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
index bf5b6be0bde90f5ec2bd37d8c8dd6b052b2b65df..b52720f737789fe6521776019348f4f075711796 100644 (file)
@@ -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();