[JAVA-2487] Mongodb Async driver with Java 8 SSL connection fail (git code says SSL unsupported) Created: 11/Apr/17  Updated: 27/Oct/23  Resolved: 06/Sep/17

Status: Closed
Project: Java Driver
Component/s: Async
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Stephen Seymour Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Java 8 openjdk
Ubuntu 16.0.4 LTS
AMD 64
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-async</artifactId>
<version>3.4.2</version>
</dependency>



 Description   

Trying my first connection to Atlas.
Connection string turns on the SSL.
Mongodb async java driver barfs.

java.lang.UnsupportedOperationException: No SSL support in java.nio.channels.AsynchronousSocketChannel.
For SSL support use com.mongodb.connection.netty.NettyStreamFactoryFactory

But SSL support is native in Java 7 and 8

https://github.com/mongodb/mongo-java-driver/blob/master/driver-core/src/main/com/mongodb/connection/AsynchronousSocketChannelStreamFactory.java.

Am I missing something?



 Comments   
Comment by Jeffrey Yemin [ 12/Apr/17 ]

As indicated in the exception message, java.nio.channels.AsynchronousSocketChannel does not have integrated SSL support, which is why the driver relies on Netty to provide the necessary integration with javax.net.ssl.SSLEngine. See http://mongodb.github.io/mongo-java-driver/3.4/driver-async/tutorials/ssl/#tls-ssl for documentation on configuration of Netty with the async driver.

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