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 2015/10/26 22:38:16 UTC

mesos git commit: SSL: Restore default flags when reinitializing.

Repository: mesos
Updated Branches:
  refs/heads/master b0c773181 -> 64c37b493


SSL: Restore default flags when reinitializing.

This moves the initialization of the SSL `Flags` into the `initialize`
method.

Prior to this, SSL flags would not be completely cleaned up between
tests.  Test cleanup unsets all environment variables related to SSL.
However, the flags object would persist some of these variables between
tests.
For example:
1) Test 1 unsets all flags, then sets flag `SSL_CA_FILE`.
2) Test 2 unsets all flags, then sets flag `SSL_CA_DIR`.
   `SSL_CA_FILE` will still be set.
3) Test 3 unsets all flags.  `SSL_CA_FILE` and `SSL_CA_DIR` are still
   set.

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


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

Branch: refs/heads/master
Commit: 64c37b493b14a09abf4814ece113e8e61c870306
Parents: b0c7731
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Mon Oct 26 15:51:01 2015 -0500
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Mon Oct 26 15:53:06 2015 -0500

----------------------------------------------------------------------
 3rdparty/libprocess/src/openssl.cpp | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/64c37b49/3rdparty/libprocess/src/openssl.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/openssl.cpp b/3rdparty/libprocess/src/openssl.cpp
index 9ae5c1f..a2b7ab4 100644
--- a/3rdparty/libprocess/src/openssl.cpp
+++ b/3rdparty/libprocess/src/openssl.cpp
@@ -279,6 +279,11 @@ string error_string(unsigned long code)
 // running (this would be undefined behavior).
 void reinitialize()
 {
+  // Wipe out and recreate the default flags.
+  // This is especially important for tests, which might repeatedly
+  // change environment variables and call `reinitialize`.
+  *ssl_flags = Flags();
+
   // Load all the flags prefixed by SSL_ from the environment. See
   // comment at top of openssl.hpp for a full list.
   Try<Nothing> load = ssl_flags->load("SSL_");