|
@@ -40,8 +40,11 @@ import java.util.Set;
|
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
+import javax.net.ssl.KeyManager;
|
|
|
import javax.net.ssl.SSLSocketFactory;
|
|
|
|
|
|
+import com.google.polo.ssl.DummySSLSocketFactory;
|
|
|
+
|
|
|
import org.apache.commons.cli.CommandLine;
|
|
|
import org.apache.commons.cli.GnuParser;
|
|
|
import org.apache.commons.cli.HelpFormatter;
|
|
@@ -140,10 +143,17 @@ public class BigScreenBot extends Bot
|
|
|
setVersion(String.format("Big Screen Bot (%1$s)", System.getProperty("os.name")));
|
|
|
|
|
|
if (settings.getBooleanProperty("ssl", false))
|
|
|
- {
|
|
|
- // TODO: figure out how to make this work with Jay's certificate
|
|
|
- setSocketFactory(SSLSocketFactory.getDefault());
|
|
|
- }
|
|
|
+ if (settings.getBooleanProperty("verify", true))
|
|
|
+ setSocketFactory(SSLSocketFactory.getDefault());
|
|
|
+ else
|
|
|
+ try
|
|
|
+ {
|
|
|
+ setSocketFactory(DummySSLSocketFactory.fromKeyManagers(new KeyManager[] {}));
|
|
|
+ }
|
|
|
+ catch (GeneralSecurityException exception)
|
|
|
+ {
|
|
|
+ error(exception, 1);
|
|
|
+ }
|
|
|
|
|
|
setLogin(System.getProperty("user.name"));
|
|
|
setName(settings.getProperty("nick", "bigscreenbot"));
|