Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-37640

no member named 'SSLCopyRequestedPeerNameLength' in the global namespace

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.4, 4.1.5
    • Affects Version/s: 4.0.3
    • Component/s: Build
    • None
    • Fully Compatible
    • ALL
    • v4.0
    • Hide

      Build mongodb 4.0.3 on OS X 10.11.

      Show
      Build mongodb 4.0.3 on OS X 10.11.
    • Dev Tools 2018-10-22, Dev Tools 2018-11-05

      Hello, we're able to build mongodb 4.0.3 on the 3 most recent versions of macOS (10.12, 10.13, 10.14), but on 10.11, the build fails:

      /opt/local/bin/clang++-mp-5.0 -o build/MP/mongo/util/net/ssl_parameters.o -c -Woverloaded-virtual -Werror=unused-result -Wpessimizing-move -Wredundant-move -Wno-undefined-var-template -Wno-instantiation-after-specialization -stdlib=libc++ -std=c++14 -arch x86_64 -fno-omit-frame-pointer -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O2 -Wno-unused-local-typedefs -Wno-unused-function -Wno-unused-private-field -Wno-deprecated-declarations -Wno-tautological-constant-out-of-range-compare -Wno-unused-const-variable -Wno-missing-braces -Wno-inconsistent-missing-override -Wno-potentially-evaluated-expression -Wno-unused-lambda-capture -Wno-exceptions -fstack-protector-strong -fno-builtin-memcmp -DPCRE_STATIC -DNDEBUG -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS -Isrc/third_party/asio-master/asio/include -Isrc/third_party/pcre-8.41 -Isrc/third_party/boost-1.60.0 -I/opt/local/include -Ibuild/MP -Isrc src/mongo/util/net/ssl_parameters.cpp
      src/mongo/util/net/ssl_manager_apple.cpp:969:25: error: no member named 'SSLCopyRequestedPeerNameLength' in the global namespace
              auto status = ::SSLCopyRequestedPeerNameLength(_ssl.get(), &len);
                            ~~^
      src/mongo/util/net/ssl_manager_apple.cpp:975:20: error: no member named 'SSLCopyRequestedPeerName' in the global namespace
              status = ::SSLCopyRequestedPeerName(_ssl.get(), &ret[0], &len);
                       ~~^
      src/mongo/util/net/ssl_manager_apple.cpp:1360:57: error: cannot initialize a parameter of type 'SecTrustResultType * _Nullable' (aka 'unsigned int *') with an rvalue of type '(anonymous enum at /System/Library/Frameworks/Security.framework/Headers/SecTrust.h:87:1) *'
          uassertOSStatusOK(::SecTrustEvaluate(cftrust.get(), &result), ErrorCodes::SSLHandshakeFailed);
                                                              ^~~~~~~
      /System/Library/Frameworks/Security.framework/Headers/SecTrust.h:345:78: note: passing argument to parameter 'result' here
      OSStatus SecTrustEvaluate(SecTrustRef trust, SecTrustResultType * __nullable result)
                                                                                   ^
      /opt/local/bin/clang++-mp-5.0 -o build/MP/mongo/util/net/ssl_manager.o -c -Woverloaded-virtual -Werror=unused-result -Wpessimizing-move -Wredundant-move -Wno-undefined-var-template -Wno-instantiation-after-specialization -stdlib=libc++ -std=c++14 -arch x86_64 -fno-omit-frame-pointer -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O2 -Wno-unused-local-typedefs -Wno-unused-function -Wno-unused-private-field -Wno-deprecated-declarations -Wno-tautological-constant-out-of-range-compare -Wno-unused-const-variable -Wno-missing-braces -Wno-inconsistent-missing-override -Wno-potentially-evaluated-expression -Wno-unused-lambda-capture -Wno-exceptions -fstack-protector-strong -fno-builtin-memcmp -DPCRE_STATIC -DNDEBUG -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS -Isrc/third_party/asio-master/asio/include -Isrc/third_party/pcre-8.41 -Isrc/third_party/boost-1.60.0 -I/opt/local/include -Ibuild/MP -Isrc src/mongo/util/net/ssl_manager.cpp
      3 errors generated.
      scons: *** [build/MP/mongo/util/net/ssl_manager_apple.o] Error 1
      scons: building terminated because of errors.
      build/MP/mongo/util/net/ssl_manager_apple.o failed: Error 1
      

      This surprises me, because Apple documentation shows that the SSLCopyRequestedPeerName and SSLCopyRequestedPeerNameLength functions should be available on 10.11, and they do seem to be defined in the 10.11 SDK, so I don't know why it says they're not found.

      I'm not familiar with C++ namespaces, and I was unfamiliar with the :: notation used in the source for accessing these functions, so I'm not sure whether the error message qualification in the global namespace is significant here, or whether these symbols would always be in the global namespace anyway.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            ryandesign Ryan Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: