File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
driver-core/src/main/com/mongodb/connection
driver/src/main/com/mongodb Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -121,12 +121,10 @@ public boolean isInvalidHostNameAllowed() {
121
121
SslSettings (final Builder builder ) {
122
122
enabled = builder .enabled ;
123
123
invalidHostNameAllowed = builder .invalidHostNameAllowed ;
124
- if (enabled && !invalidHostNameAllowed ) {
125
- if (System .getProperty ("java.version" ).startsWith ("1.6." )) {
126
- throw new MongoInternalException ("By default, SSL connections are only supported on Java 7 or later. If the application "
127
- + "must run on Java 6, you must set the SslSettings.invalidHostNameAllowed property to "
128
- + "false" );
129
- }
124
+ if (enabled && !invalidHostNameAllowed && System .getProperty ("java.version" ).startsWith ("1.6." )) {
125
+ throw new MongoInternalException ("By default, SSL connections are only supported on Java 7 or later. If the application "
126
+ + "must run on Java 6, you must set the SslSettings.invalidHostNameAllowed property to "
127
+ + "true" );
130
128
}
131
129
}
132
130
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ private MongoClientOptions(final Builder builder) {
174
174
// The error message from SslSettings needs to be translated to make sense for users of MongoClientOptions
175
175
throw new MongoInternalException ("By default, SSL connections are only supported on Java 7 or later. If the application "
176
176
+ "must run on Java 6, you must set the MongoClientOptions.sslInvalidHostNameAllowed "
177
- + "property to false " );
177
+ + "property to true " );
178
178
}
179
179
}
180
180
You can’t perform that action at this time.
0 commit comments