Exception com.mongodb.MongoInternalException has error in its message

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Trivial - P5
    • 3.5.0
    • Affects Version/s: None
    • Component/s: Error Handling
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The exception message suggests to set sslInvalidHostNameAllowed property to false when using java 1.6 while the code is checking for the opposite condition in https://github.com/mongodb/mongo-java-driver/blob/master/driver-core/src/main/com/mongodb/connection/SslSettings.java#L124
      :

       SslSettings(final Builder builder) {
              enabled = builder.enabled;
              invalidHostNameAllowed = builder.invalidHostNameAllowed;
              if (enabled && !invalidHostNameAllowed) {
                  if (System.getProperty("java.version").startsWith("1.6.")) {
                      throw new MongoInternalException("By default, SSL connections are only supported on Java 7 or later.  If the application "
                                                       + "must run on Java 6, you must set the SslSettings.invalidHostNameAllowed property to "
                                                       + "false");
                  }
              }
          }
      

              Assignee:
              Ross Lawley
              Reporter:
              Wojciech [X]
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: