]> git.apps.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)
committerJonathan Brielmaier <jbrielmaier@suse.de>
Tue, 13 Nov 2018 15:20:04 +0000 (16:20 +0100)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 9836ee2643c38afcd0221488d607dffa359e9bd4)
Signed-off-by: Jonathan Brielmaier <jbrielmaier@suse.de>
doc/radosgw/frontends.rst
src/rgw/rgw_asio_frontend.cc

index 71532675553a4d4f3feac5280d7fa290731dc907..768e1d777950c607e7567dd451437fa5d1386e9d 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 c079e0aa37f99e379233783d07b283c36fef749a..42efc13c7c562910c7685a9664d2a637206a7bbd 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 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 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();