Java Code Examples for sun.security.ssl.Debug#isOn()

The following examples show how to use sun.security.ssl.Debug#isOn() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KerberosClientKeyExchangeImpl.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 2
Source File: KerberosClientKeyExchangeImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 3
Source File: KerberosClientKeyExchangeImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 4
Source File: KerberosClientKeyExchangeImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 5
Source File: KerberosClientKeyExchangeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 6
Source File: Krb5KeyExchangeService.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret", preMaster.getEncrypted());
    }
}
 
Example 7
Source File: KerberosClientKeyExchangeImpl.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 8
Source File: KerberosClientKeyExchangeImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 9
Source File: KerberosClientKeyExchangeImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 10
Source File: KerberosClientKeyExchangeImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 11
Source File: KerberosClientKeyExchangeImpl.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 12
Source File: KerberosClientKeyExchangeImpl.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 13
Source File: KerberosClientKeyExchangeImpl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void print(PrintStream s) throws IOException {
    s.println("*** ClientKeyExchange, Kerberos");

    if (debug != null && Debug.isOn("verbose")) {
        Debug.println(s, "Kerberos service ticket", encodedTicket);
        Debug.println(s, "Random Secret", preMaster.getUnencrypted());
        Debug.println(s, "Encrypted random Secret",
            preMaster.getEncrypted());
    }
}
 
Example 14
Source File: Krb5KeyExchangeService.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Object getServiceCreds(AccessControlContext acc) {
    try {
        ServiceCreds serviceCreds = AccessController.doPrivileged(
                (PrivilegedExceptionAction<ServiceCreds>)
                        () -> Krb5Util.getServiceCreds(
                                GSSCaller.CALLER_SSL_SERVER, null, acc));
        if (serviceCreds == null) {
            if (debug != null && Debug.isOn("handshake")) {
                System.out.println("Kerberos serviceCreds not available");
            }
            return null;
        }
        if (debug != null && Debug.isOn("handshake")) {
            System.out.println("Using Kerberos creds");
        }
        String serverPrincipal = serviceCreds.getName();
        if (serverPrincipal != null) {
            // When service is bound, we check ASAP. Otherwise,
            // will check after client request is received
            // in in Kerberos ClientKeyExchange
            SecurityManager sm = System.getSecurityManager();
            try {
                if (sm != null) {
                    // Eliminate dependency on ServicePermission
                    sm.checkPermission(new ServicePermission(
                            serverPrincipal, "accept"), acc);
                }
            } catch (SecurityException se) {
                if (debug != null && Debug.isOn("handshake")) {
                    System.out.println("Permission to access Kerberos"
                            + " secret key denied");
                }
                return null;
            }
        }
        return serviceCreds;
    } catch (PrivilegedActionException e) {
        // Likely exception here is LoginException
        if (debug != null && Debug.isOn("handshake")) {
            System.out.println("Attempt to obtain Kerberos key failed: "
                    + e.toString());
        }
        return null;
    }
}
 
Example 15
Source File: Krb5KeyExchangeService.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean isRelated(boolean isClient,
        AccessControlContext acc, Principal p) {

    if (p == null) return false;
    try {
        Subject subject = AccessController.doPrivileged(
                (PrivilegedExceptionAction<Subject>)
                        () -> Krb5Util.getSubject(
                                isClient ? GSSCaller.CALLER_SSL_CLIENT
                                        : GSSCaller.CALLER_SSL_SERVER,
                                acc));
        if (subject == null) {
            if (debug != null && Debug.isOn("session")) {
                System.out.println("Kerberos credentials are" +
                        " not present in the current Subject;" +
                        " check if " +
                        " javax.security.auth.useSubjectAsCreds" +
                        " system property has been set to false");
            }
            return false;
        }
        Set<Principal> principals =
                subject.getPrincipals(Principal.class);
        if (principals.contains(p)) {
            // bound to this principal
            return true;
        } else {
            if (isClient) {
                return false;
            } else {
                for (KeyTab pc : subject.getPrivateCredentials(KeyTab.class)) {
                    if (!pc.isBound()) {
                        return true;
                    }
                }
                return false;
            }
        }
    } catch (PrivilegedActionException pae) {
        if (debug != null && Debug.isOn("session")) {
            System.out.println("Attempt to obtain" +
                    " subject failed! " + pae);
        }
        return false;
    }

}