~ubuntu-branches/ubuntu/raring/icedtea-web/raring

« back to all changes in this revision

Viewing changes to netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-02-04 18:19:46 UTC
  • mfrom: (1.1.16)
  • Revision ID: package-import@ubuntu.com-20120204181946-jngobgzz4mlen9yl
Tags: 1.2~pre1-0ubuntu1
* Update to hg 20120203, taken from the icedtea-web-1.2 release branch.
* Build separate plugin packages for OpenJDK 6 and OpenJDK 7, needed
  to provide the path to the runtime and the mime description in the plugin.
* Use icedtea-<jre version>-plugin as the name for both plugin packages.
* Remove icedtea-web-1.1.4-npapi-fix.patch, fixed upstream.
* Pass -n to gzip when compressing manpages to be Multi-Arch: same safe.
* Build multiarch packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
import javax.jnlp.*;
30
30
import javax.naming.ConfigurationException;
31
31
import javax.net.ssl.HttpsURLConnection;
 
32
import javax.net.ssl.KeyManagerFactory;
32
33
import javax.net.ssl.SSLContext;
33
34
import javax.net.ssl.SSLSocketFactory;
34
35
import javax.net.ssl.TrustManager;
123
124
    /** set to false to indicate another JVM should not be spawned, even if necessary */
124
125
    private static boolean forksAllowed = true;
125
126
 
 
127
    /** all security dialogs will be consumed and pretented as beeing verified by user and allowed.*/
 
128
    private static boolean trustAll=false;
 
129
 
126
130
    /** contains the arguments passed to the jnlp runtime */
127
131
    private static List<String> initialArguments;
128
132
 
132
136
    public static final String STDERR_FILE = "java.stderr";
133
137
    public static final String STDOUT_FILE = "java.stdout";
134
138
 
 
139
 
135
140
    /**
136
141
     * Returns whether the JNLP runtime environment has been
137
142
     * initialized.  Once initialized, some properties such as the
221
226
        try {
222
227
            SSLSocketFactory sslSocketFactory;
223
228
            SSLContext context = SSLContext.getInstance("SSL");
 
229
            KeyStore ks = KeyStores.getKeyStore(KeyStores.Level.USER, KeyStores.Type.CLIENT_CERTS);
 
230
            KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
 
231
            kmf.init(ks, KeyStores.getPassword());
224
232
            TrustManager[] trust = new TrustManager[] { VariableX509TrustManager.getInstance() };
225
 
            context.init(null, trust, null);
 
233
            context.init(kmf.getKeyManagers(), trust, null);
226
234
            sslSocketFactory = context.getSocketFactory();
227
235
 
228
236
            HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
732
740
        }
733
741
    }
734
742
 
 
743
    static void setTrustAll(boolean b) {
 
744
        trustAll=b;
 
745
    }
 
746
 
 
747
    public static boolean isTrustAll() {
 
748
        return trustAll;
 
749
    }
 
750
 
735
751
}