diff --git a/src/main/java/com/jcraft/jsch/jgss/GSSContextKrb5.java b/src/main/java/com/jcraft/jsch/jgss/GSSContextKrb5.java index 689da9c4..6ac06bed 100644 --- a/src/main/java/com/jcraft/jsch/jgss/GSSContextKrb5.java +++ b/src/main/java/com/jcraft/jsch/jgss/GSSContextKrb5.java @@ -50,7 +50,7 @@ public void create(String user, String host) throws JSchException { // RFC 1964 Oid krb5 = new Oid("1.2.840.113554.1.2.2"); // Kerberos Principal Name Form - Oid principalName = new Oid("1.2.840.113554.1.2.2.1"); + Oid principalName = GSSName.NT_HOSTBASED_SERVICE; GSSManager mgr = GSSManager.getInstance(); @@ -66,7 +66,7 @@ public void create(String user, String host) throws JSchException { cname = InetAddress.getByName(cname).getCanonicalHostName(); } catch (UnknownHostException e) { } - GSSName _host = mgr.createName("host/" + cname, principalName); + GSSName _host = mgr.createName("host@" + cname, principalName); context = mgr.createContext(_host, krb5, crd, GSSContext.DEFAULT_LIFETIME);