Permalink
Browse files

issue42: add SSL support

  • Loading branch information...
1 parent 4eb79d2 commit 8f5455f233b2febbdb279c8ac071de3421d37756 @agirbal committed Nov 15, 2011
View
BIN lib/SwingFast.jar
Binary file not shown.
View
BIN lib/bson.jar
Binary file not shown.
View
BIN lib/mongo.jar
Binary file not shown.
View
1 resource/xml/JMongoBrowser.xml
@@ -657,6 +657,7 @@
<IntSpinner id="maxWaitTime" minValue="0" value="120000" toolTipText="Maximum time in milliseconds that a thread should wait for a connection to be available"/>
</Div>
<Div id="connection" titled="true">
+ <ComboBox id="socketType" value="0" items="Plain;SSL" toolTipText="Type of socket to use."/>
<IntSpinner id="connectTimeout" minValue="0" value="0" toolTipText="Timeout for the socket connect operation"/>
<IntSpinner id="socketTimeout" minValue="0" value="0" toolTipText="Timeout for the socket read/write operations"/>
<CheckBox id="autoConnectRetry" value="false" toolTipText="If true, then driver will keep retrying to connect to the server in case of connection failure"/>
View
6 src/org/mongo/jmongob/ConnectDialog.java
@@ -6,6 +6,7 @@
import com.edgytech.swingfast.FormDialog;
import com.mongodb.MongoOptions;
+import javax.net.ssl.SSLSocketFactory;
/**
*
@@ -21,6 +22,7 @@
connectionsPerHost,
blockingThreadMultiplier,
maxWaitTime,
+ socketType,
connectTimeout,
socketTimeout,
autoConnectRetry,
@@ -50,6 +52,10 @@ MongoOptions getMongoOptions() {
moptions.socketTimeout = getIntFieldValue(Item.socketTimeout);
moptions.autoConnectRetry = getBooleanFieldValue(Item.autoConnectRetry);
moptions.safe = getBooleanFieldValue(Item.safe);
+
+ int stype = getIntFieldValue(Item.socketType);
+ if (stype == 1)
+ moptions.socketFactory = SSLSocketFactory.getDefault();
return moptions;
}

0 comments on commit 8f5455f

Please sign in to comment.