[JAVA-2490] Exception com.mongodb.MongoInternalException has error in its message Created: 13/Apr/17  Updated: 05/Jun/17  Resolved: 25/Apr/17

Status: Closed
Project: Java Driver
Component/s: Error Handling
Affects Version/s: None
Fix Version/s: 3.5.0

Type: Bug Priority: Trivial - P5
Reporter: Wojciech [X] Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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");
            }
        }
    }



 Comments   
Comment by Githook User [ 25/Apr/17 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Corrected Java 1.6 error message where invalidHostNameAllowed is false

JAVA-2490
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/c45dae7152294d2421fef8463b3b15275e9d6cb0

Comment by Ross Lawley [ 25/Apr/17 ]

PR: https://github.com/rozza/mongo-java-driver/pull/188

Comment by Ross Lawley [ 13/Apr/17 ]

Thanks for the ticket WojciechK we'll update the exception message in the next release.

Generated at Thu Feb 08 08:57:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.