~ubuntu-branches/ubuntu/oneiric/icedtea-web/oneiric-security

« back to all changes in this revision

Viewing changes to netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-09-04 16:42:35 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: package-import@ubuntu.com-20110904164235-sua1vs1n6kyczrv4
Tags: 1.1.2-0ubuntu1
* New upstream release.
  - PR769: IcedTea-Web does not work with some ssl sites.

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
        // need to prompt the user
225
225
        if (!isExplicitlyTrusted(chain, authType)) {
226
226
 
227
 
            try {
228
 
                HostnameChecker checker = HostnameChecker
229
 
                        .getInstance(HostnameChecker.TYPE_TLS);
230
 
 
231
 
                checker.match(hostName, chain[0]); // only need to match @ 0 for
232
 
                                                   // CN
233
 
 
234
 
            } catch (CertificateException e) {
 
227
            if (hostName == null) {
235
228
                CNMatched = false;
236
 
                ce = e;
 
229
            } else {
 
230
                try {
 
231
                    HostnameChecker checker = HostnameChecker
 
232
                            .getInstance(HostnameChecker.TYPE_TLS);
 
233
 
 
234
                    checker.match(hostName, chain[0]); // only need to match @ 0 for
 
235
                                                       // CN
 
236
 
 
237
                } catch (CertificateException e) {
 
238
                    CNMatched = false;
 
239
                    ce = e;
 
240
                }
237
241
            }
238
242
        }
239
243