From f9325048496d7cdbcad233f8a6b84c88e79adcc2 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Tue, 17 Sep 2019 20:11:47 -0400
Subject: [PATCH] Rename link2master to link2support.

---
 Grafreed.java |   66 +++++++++++++++++++++++++++++++--
 1 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/Grafreed.java b/Grafreed.java
index 40116a4..28064c8 100644
--- a/Grafreed.java
+++ b/Grafreed.java
@@ -13,6 +13,17 @@
 
 import javax.sound.sampled.*;
 
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+import java.security.cert.X509Certificate;
+import java.net.Authenticator;
+import java.net.PasswordAuthentication;
+
 //import com.jamonapi.*;
 public class Grafreed extends Applet implements ActionListener
 {        
@@ -677,10 +688,14 @@
     
     public static void main(String argv[])
     {
-         String osArch = System.getProperty("os.arch");
+        String osArch = System.getProperty("os.arch");
         if (Globals.DEBUG)
                 System.out.println("os.arch = " + osArch);
                 
+        String osName = System.getProperty("os.name");
+
+        isWindows = !osName.equals("Mac OS X");
+            
         if (argv.length == 0)
         {
             String javaPath = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
@@ -706,7 +721,6 @@
             // -Djava.library.path=/Users/nbriere/Projects/shared/lib
         if (jarfile.charAt(2) == ':')
         {
-            isWindows = true;
             command = "\"" + javaPath + "\" -Xmx1024m -Djava.library.path=" + jarpath;
                 // On Windows systems, the path is /C:/
                 jarfile = jarfile.substring(1, jarfile.length());
@@ -1014,6 +1028,50 @@
                 }
         }
 /**/
+        
+        // Create a trust manager that does not validate certificate chains
+        final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
+            @Override
+            public void checkClientTrusted(final X509Certificate[] chain, final String authType) {
+            }
+
+            @Override
+            public void checkServerTrusted(final X509Certificate[] chain, final String authType) {
+            }
+
+            @Override
+            public X509Certificate[] getAcceptedIssuers() {
+                return null;
+            }
+        } };
+
+        try
+        {
+            // Install the all-trusting trust manager
+            final SSLContext sslContext = SSLContext.getInstance("SSL");
+            sslContext.init(null, trustAllCerts, null);
+            // Create an ssl socket factory with our all-trusting manager
+            HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
+            HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
+                public boolean verify(String urlHostName, SSLSession session) {
+                    return true;
+                }
+            });
+            // be authentic
+            Authenticator.setDefault(new Authenticator() {
+                @Override
+                protected PasswordAuthentication getPasswordAuthentication() {
+                    return new PasswordAuthentication("args[0]", "args[1]".toCharArray());
+                }
+            });
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        
+        
+        /////////////
 
 //        javax.swing.ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
         
@@ -1027,13 +1085,13 @@
         grafreed.universe = new cGroup();
         grafreed.universe.name = "Grafreed";
         grafreed.universe.material = new cMaterial();
-        grafreed.universe.skyboxname = "cubemaps/penguins-skyboxes/yonder";
-        grafreed.universe.skyboxext = "jpg";
         
         //   theApplet3D.universe.textures = CameraPane.DEFAULT_TEXTURE;
 
         grafreed.universe.root = true;
         grafreed.universe.openEditWindow(null, true); //, true);
+        grafreed.universe.editWindow.New();
+        
         //mon.stop();
         //System.out.println(mon);
         //timeflow.app.TimeflowAppLauncher.GetTimeFlow();

--
Gitblit v1.6.2