Skip to content

Instantly share code, notes, and snippets.

@FrancescaK
Created August 18, 2014 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrancescaK/2eeee1537c3f888e776c to your computer and use it in GitHub Desktop.
Save FrancescaK/2eeee1537c3f888e776c to your computer and use it in GitHub Desktop.
kerberos_4
import com.mongodb.*;
import javax.net.ssl.SSLSocketFactory;
import java.util.Arrays;
public class SSLApp {
public static void main(String args[]) throws Exception {
MongoClient m = new MongoClient(new MongoClientURI("mongodb://gssapitest%40MONGOTEST.COM@rhel64.mongotest.com/?authMechanism=GSSAPI&ssl=true"));
DB db = m.getDB( "test" );
DBCollection c = db.getCollection( "test");
System.out.println( c.findOne() );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment