File tree Expand file tree Collapse file tree 6 files changed +4
-45
lines changed
main/com/mongodb/connection
test/functional/com/mongodb
driver-legacy/src/test/functional/com/mongodb
driver-sync/src/test/functional/com/mongodb/client Expand file tree Collapse file tree 6 files changed +4
-45
lines changed Original file line number Diff line number Diff line change @@ -143,8 +143,6 @@ public Builder applyConnectionString(final ConnectionString connectionString) {
143
143
* Create a new SSLSettings from the settings in this builder.
144
144
*
145
145
* @return a new SSL settings
146
- * @throws com.mongodb.MongoInternalException if enabled is true, invalidHostNameAllowed is false, and the {@code "java.version"}
147
- * system property starts with 1.6
148
146
*/
149
147
public SslSettings build () {
150
148
return new SslSettings (this );
Original file line number Diff line number Diff line change 16
16
17
17
package com .mongodb ;
18
18
19
- import com .mongodb .internal .async .AsyncBatchCursor ;
20
19
import com .mongodb .async .FutureResultCallback ;
21
- import com .mongodb .internal .async .SingleResultCallback ;
22
20
import com .mongodb .connection .AsynchronousSocketChannelStreamFactory ;
23
21
import com .mongodb .connection .ClusterSettings ;
24
22
import com .mongodb .connection .ClusterType ;
32
30
import com .mongodb .connection .StreamFactory ;
33
31
import com .mongodb .connection .TlsChannelStreamFactoryFactory ;
34
32
import com .mongodb .connection .netty .NettyStreamFactory ;
33
+ import com .mongodb .internal .async .AsyncBatchCursor ;
34
+ import com .mongodb .internal .async .SingleResultCallback ;
35
35
import com .mongodb .internal .binding .AsyncClusterBinding ;
36
36
import com .mongodb .internal .binding .AsyncConnectionSource ;
37
37
import com .mongodb .internal .binding .AsyncReadBinding ;
@@ -373,11 +373,7 @@ public static SslSettings getSslSettings() {
373
373
}
374
374
375
375
public static SslSettings getSslSettings (final ConnectionString connectionString ) {
376
- SslSettings .Builder builder = SslSettings .builder ().applyConnectionString (connectionString );
377
- if (System .getProperty ("java.version" ).startsWith ("1.6." )) {
378
- builder .invalidHostNameAllowed (true );
379
- }
380
- return builder .build ();
376
+ return SslSettings .builder ().applyConnectionString (connectionString ).build ();
381
377
}
382
378
383
379
public static ServerAddress getPrimary () {
Original file line number Diff line number Diff line change 16
16
17
17
package com .mongodb .internal .async .client ;
18
18
19
- import com .mongodb .Block ;
20
19
import com .mongodb .ClusterFixture ;
21
20
import com .mongodb .ConnectionString ;
22
21
import com .mongodb .MongoClientSettings ;
26
25
import com .mongodb .MongoTimeoutException ;
27
26
import com .mongodb .async .FutureResultCallback ;
28
27
import com .mongodb .connection .AsynchronousSocketChannelStreamFactoryFactory ;
29
- import com .mongodb .connection .SslSettings ;
30
28
import com .mongodb .connection .StreamFactoryFactory ;
31
29
import com .mongodb .connection .TlsChannelStreamFactoryFactory ;
32
30
import org .bson .Document ;
@@ -63,14 +61,6 @@ public static MongoClientSettings getMongoClientSettings() {
63
61
public static com .mongodb .MongoClientSettings .Builder getMongoClientBuilderFromConnectionString () {
64
62
com .mongodb .MongoClientSettings .Builder builder = com .mongodb .MongoClientSettings .builder ()
65
63
.applyConnectionString (getConnectionString ());
66
- if (System .getProperty ("java.version" ).startsWith ("1.6." )) {
67
- builder .applyToSslSettings (new Block <SslSettings .Builder >() {
68
- @ Override
69
- public void apply (final SslSettings .Builder builder ) {
70
- builder .invalidHostNameAllowed (true );
71
- }
72
- });
73
- }
74
64
builder .streamFactoryFactory (getStreamFactoryFactory ());
75
65
return builder ;
76
66
}
Original file line number Diff line number Diff line change @@ -81,14 +81,7 @@ public static synchronized MongoClientURI getMongoClientURI() {
81
81
}
82
82
83
83
public static synchronized MongoClientURI getMongoClientURI (final MongoClientOptions .Builder builder ) {
84
- MongoClientURI mongoClientURI = null ;
85
- String mongoURIString = getMongoClientURIString ();
86
- if (System .getProperty ("java.version" ).startsWith ("1.6." )) {
87
- builder .sslInvalidHostNameAllowed (true );
88
- }
89
-
90
- mongoClientURI = new MongoClientURI (mongoURIString , builder );
91
- return mongoClientURI ;
84
+ return new MongoClientURI (getMongoClientURIString (), builder );
92
85
}
93
86
94
87
public static MongoClientOptions getOptions () {
Original file line number Diff line number Diff line change 24
24
import com .mongodb .client .internal .MongoClientImpl ;
25
25
import com .mongodb .connection .ServerDescription ;
26
26
import com .mongodb .connection .ServerSettings ;
27
- import com .mongodb .connection .SslSettings ;
28
27
29
28
import java .util .List ;
30
29
import java .util .concurrent .TimeUnit ;
@@ -93,14 +92,6 @@ public void apply(final ServerSettings.Builder builder) {
93
92
builder .minHeartbeatFrequency (MIN_HEARTBEAT_FREQUENCY_MS , TimeUnit .MILLISECONDS );
94
93
}
95
94
});
96
- if (System .getProperty ("java.version" ).startsWith ("1.6." )) {
97
- builder .applyToSslSettings (new Block <SslSettings .Builder >() {
98
- @ Override
99
- public void apply (final SslSettings .Builder builder ) {
100
- builder .invalidHostNameAllowed (true );
101
- }
102
- });
103
- }
104
95
mongoClientSettings = builder .build ();
105
96
}
106
97
return mongoClientSettings ;
Original file line number Diff line number Diff line change 20
20
import com .mongodb .MongoClientSettings ;
21
21
import com .mongodb .MongoException ;
22
22
import com .mongodb .connection .SocketSettings ;
23
- import com .mongodb .connection .SslSettings ;
24
23
import org .bson .Document ;
25
24
import org .junit .After ;
26
25
import org .junit .Before ;
@@ -47,14 +46,6 @@ public void setUp() {
47
46
assumeTrue (canRunTests ());
48
47
MongoClientSettings .Builder builder = MongoClientSettings .builder ()
49
48
.applyConnectionString (getMultiMongosConnectionString ());
50
- if (System .getProperty ("java.version" ).startsWith ("1.6." )) {
51
- builder .applyToSslSettings (new Block <SslSettings .Builder >() {
52
- @ Override
53
- public void apply (final SslSettings .Builder builder ) {
54
- builder .invalidHostNameAllowed (true );
55
- }
56
- });
57
- }
58
49
59
50
client = MongoClients .create (MongoClientSettings .builder (builder .build ())
60
51
.applyToSocketSettings (new Block <SocketSettings .Builder >() {
You can’t perform that action at this time.
0 commit comments