]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: ssl: don't try to init certificate if not needed
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 20 Feb 2020 19:33:33 +0000 (11:33 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Sat, 29 Feb 2020 03:16:47 +0000 (19:16 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_asio_frontend.cc

index 6855a18c403b5113e26b65cd919cca4b390b5eff..4fca9aece663757e6c91faf4bd385fc4eee164eb 100644 (file)
@@ -690,6 +690,17 @@ int AsioFrontend::init_ssl()
     return -EINVAL;
   }
 
+  auto ports = config.equal_range("ssl_port");
+  auto endpoints = config.equal_range("ssl_endpoint");
+
+  /*
+   * don't try to config certificate if frontend isn't configured for ssl
+   */
+  if (ports.first == ports.second &&
+      endpoints.first == endpoints.second) {
+    return 0;
+  }
+
   bool key_is_cert = false;
 
   if (cert) {
@@ -719,7 +730,6 @@ int AsioFrontend::init_ssl()
   }
 
   // parse ssl endpoints
-  auto ports = config.equal_range("ssl_port");
   for (auto i = ports.first; i != ports.second; ++i) {
     if (!have_cert) {
       lderr(ctx()) << "no ssl_certificate configured for ssl_port" << dendl;
@@ -739,7 +749,6 @@ int AsioFrontend::init_ssl()
     listeners.back().use_ssl = true;
   }
 
-  auto endpoints = config.equal_range("ssl_endpoint");
   for (auto i = endpoints.first; i != endpoints.second; ++i) {
     if (!have_cert) {
       lderr(ctx()) << "no ssl_certificate configured for ssl_endpoint" << dendl;