Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2490

Exception com.mongodb.MongoInternalException has error in its message

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.5.0
    • Affects Version/s: None
    • Component/s: Error Handling
    • Labels:
      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@mongodb.com Ross Lawley
            Reporter:
            WojciechK Wojciech [X]
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: