Normand Briere
2019-09-18 f9325048496d7cdbcad233f8a6b84c88e79adcc2
Grafreed.java
....@@ -13,6 +13,17 @@
1313
1414 import javax.sound.sampled.*;
1515
16
+import javax.net.ssl.HostnameVerifier;
17
+import javax.net.ssl.HttpsURLConnection;
18
+import javax.net.ssl.SSLContext;
19
+import javax.net.ssl.SSLSession;
20
+import javax.net.ssl.TrustManager;
21
+import javax.net.ssl.X509TrustManager;
22
+
23
+import java.security.cert.X509Certificate;
24
+import java.net.Authenticator;
25
+import java.net.PasswordAuthentication;
26
+
1627 //import com.jamonapi.*;
1728 public class Grafreed extends Applet implements ActionListener
1829 {
....@@ -673,12 +684,18 @@
673684 PlayWord(word, 1);
674685 }
675686
687
+ static boolean isWindows;
688
+
676689 public static void main(String argv[])
677690 {
678
- String osArch = System.getProperty("os.arch");
691
+ String osArch = System.getProperty("os.arch");
679692 if (Globals.DEBUG)
680693 System.out.println("os.arch = " + osArch);
681694
695
+ String osName = System.getProperty("os.name");
696
+
697
+ isWindows = !osName.equals("Mac OS X");
698
+
682699 if (argv.length == 0)
683700 {
684701 String javaPath = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
....@@ -1011,6 +1028,50 @@
10111028 }
10121029 }
10131030 /**/
1031
+
1032
+ // Create a trust manager that does not validate certificate chains
1033
+ final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
1034
+ @Override
1035
+ public void checkClientTrusted(final X509Certificate[] chain, final String authType) {
1036
+ }
1037
+
1038
+ @Override
1039
+ public void checkServerTrusted(final X509Certificate[] chain, final String authType) {
1040
+ }
1041
+
1042
+ @Override
1043
+ public X509Certificate[] getAcceptedIssuers() {
1044
+ return null;
1045
+ }
1046
+ } };
1047
+
1048
+ try
1049
+ {
1050
+ // Install the all-trusting trust manager
1051
+ final SSLContext sslContext = SSLContext.getInstance("SSL");
1052
+ sslContext.init(null, trustAllCerts, null);
1053
+ // Create an ssl socket factory with our all-trusting manager
1054
+ HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
1055
+ HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
1056
+ public boolean verify(String urlHostName, SSLSession session) {
1057
+ return true;
1058
+ }
1059
+ });
1060
+ // be authentic
1061
+ Authenticator.setDefault(new Authenticator() {
1062
+ @Override
1063
+ protected PasswordAuthentication getPasswordAuthentication() {
1064
+ return new PasswordAuthentication("args[0]", "args[1]".toCharArray());
1065
+ }
1066
+ });
1067
+ }
1068
+ catch (Exception e)
1069
+ {
1070
+ e.printStackTrace();
1071
+ }
1072
+
1073
+
1074
+ /////////////
10141075
10151076 // javax.swing.ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
10161077
....@@ -1024,13 +1085,13 @@
10241085 grafreed.universe = new cGroup();
10251086 grafreed.universe.name = "Grafreed";
10261087 grafreed.universe.material = new cMaterial();
1027
- grafreed.universe.skyboxname = "cubemaps/penguins-skyboxes/yonder";
1028
- grafreed.universe.skyboxext = "jpg";
10291088
10301089 // theApplet3D.universe.textures = CameraPane.DEFAULT_TEXTURE;
10311090
10321091 grafreed.universe.root = true;
10331092 grafreed.universe.openEditWindow(null, true); //, true);
1093
+ grafreed.universe.editWindow.New();
1094
+
10341095 //mon.stop();
10351096 //System.out.println(mon);
10361097 //timeflow.app.TimeflowAppLauncher.GetTimeFlow();