You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/12/10 02:02:17 UTC

[10/12] mesos git commit: Made use of SSL flags to determine scheduler/executor scheme.

Made use of SSL flags to determine scheduler/executor scheme.

This patch updates the HTTP scheduler and executor
libraries to use process::network::openssl::flags()
to determine whether or not SSL is enabled.

Review: https://reviews.apache.org/r/50969/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4c0ab5ea
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4c0ab5ea
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4c0ab5ea

Branch: refs/heads/master
Commit: 4c0ab5eadc8bd07976626124457c9dcd932372b8
Parents: f61f321
Author: Greg Mann <gr...@mesosphere.io>
Authored: Fri Dec 9 16:44:56 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Fri Dec 9 18:01:32 2016 -0800

----------------------------------------------------------------------
 src/executor/executor.cpp   | 12 +++++++++++-
 src/scheduler/scheduler.cpp | 13 ++++---------
 2 files changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4c0ab5ea/src/executor/executor.cpp
----------------------------------------------------------------------
diff --git a/src/executor/executor.cpp b/src/executor/executor.cpp
index 1d47b52..9591cd2 100644
--- a/src/executor/executor.cpp
+++ b/src/executor/executor.cpp
@@ -33,6 +33,8 @@
 #include <process/protobuf.hpp>
 #include <process/timer.hpp>
 
+#include <process/ssl/flags.hpp>
+
 #include <stout/duration.hpp>
 #include <stout/lambda.hpp>
 #include <stout/nothing.hpp>
@@ -205,8 +207,16 @@ public:
     UPID upid(value.get());
     CHECK(upid) << "Failed to parse MESOS_SLAVE_PID '" << value.get() << "'";
 
+    string scheme = "http";
+
+#ifdef USE_SSL_SOCKET
+    if (process::network::openssl::flags().enabled) {
+      scheme = "https";
+    }
+#endif // USE_SSL_SOCKET
+
     agent = ::URL(
-        "http",
+        scheme,
         upid.address.ip,
         upid.address.port,
         upid.id +

http://git-wip-us.apache.org/repos/asf/mesos/blob/4c0ab5ea/src/scheduler/scheduler.cpp
----------------------------------------------------------------------
diff --git a/src/scheduler/scheduler.cpp b/src/scheduler/scheduler.cpp
index 956f487..ce69258 100644
--- a/src/scheduler/scheduler.cpp
+++ b/src/scheduler/scheduler.cpp
@@ -57,6 +57,8 @@
 #include <process/metrics/gauge.hpp>
 #include <process/metrics/metrics.hpp>
 
+#include <process/ssl/flags.hpp>
+
 #include <stout/check.hpp>
 #include <stout/duration.hpp>
 #include <stout/error.hpp>
@@ -453,17 +455,10 @@ protected:
       string scheme = "http";
 
 #ifdef USE_SSL_SOCKET
-      // TODO(gkleiman): Update this once the deprecation cycle is over (see
-      // MESOS-6492).
-      Option<string> value = os::getenv("SSL_ENABLED");
-      if (value.isNone()) {
-        value = os::getenv("LIBPROCESS_SSL_ENABLED");
-      }
-
-      if (value.isSome() && (value.get() == "1" || value.get() == "true")) {
+      if (process::network::openssl::flags().enabled) {
         scheme = "https";
       }
-#endif
+#endif // USE_SSL_SOCKET
 
       master = ::URL(
         scheme,