Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Invalid Kerberos Encryption Types

843811Jan 31 2005 — edited May 4 2005
Hu guys,

I'm currently setting up a J2EE web-app to use Kerberos via HTTP (by using the jcifs-ext package, which uses JAAS and JGSS through the Negotiate protocol), but after an age of finding out how everything should be set up, I've hit a problem at what I think is the last stage.

Basically the problem is that whenever I run the app, I receive a GSSException, specifically: "Failure unspecified at GSS-API level (Mechanism level: KDC has no support for encryption type (14)".

I'm assuming that this is something to do with Windows Active Directory and Java only being able to communicate via DES encryption. I think its the KDC not being able to decode the messages, but I am positive AD is all set up fine. All the principals and users are set up to use DES encryption and have had their password hashes reset and the krb5.conf file specifies des-cbc-crc and des-cbc-md5 for the ticket encoding. But then again a look at the event log reveals inconsistent KDC errors saying the client and server did not have a suitable key for generating a kerberos ticket. It suggests I reset the passwords if the encryption type is valid (which I think it is), but this doesn't make any difference.

Below is the stack trace (I'll bet you were looking forward to seeing it). The only things I can see that cause concern is the "DsGetDcName returned 1355", "Found no TGT's in LSA" and "null credentials from ticket cache". I know that the first means that the DC wasn't located though DNS, which is disconcerting, but then an Ethereal capture clearly shows that the DC specified in the config files is being found. In fact the capture shows that there are no errors in getting the tickets and authenticating. The SPNEGO encryption looks correct and is sent to the client, but is responded to with the stack trace below. Specifically, the app server gets an AS-REQ followed by an AS-REP. The client has the same but followed by a TGT-REQ and TGT-REP, however the client traffic is received in des-cbc-md5 encryption and the server traffic is in des-cbc-crc format. No mention of a Kerberos encryption error. Would this difference be the problem, or would it in any way prevent the server from sending its TGS-REQ? I've tried setting krb5.conf to only 1 of them, and both, but no difference.

Any help would be greatly appreciated. I'm using Win2K pro on the client and server and Win 2K Server on the DC, as well as Java 1.4.1_07 (is this where the problem lies?) and J2EE 1.4.

Debug is  true storeKey true useTicketCache true useKeyTab true doNotPrompt false ticketCache is null KeyTab is C:\kerbwebserv.keytab principal is HTT
P/kerbwebserv.realm.com@REALM.COM tryFirstPass is false useFirstPass is false storePass is false clearPass is false
KinitOptions cache name is C:\Documents and Settings\kerbadmin\krb5cc_kerbadmin
DsGetDcName returned 1355
Found no TGT's in LSA
Principal is HTTP/kerbwebserv.realm.com@REALM.COM null credentials from Ticket Cache
KeyTab: load() entry length: 67
KeyTabInputStream, readName(): REALM.COM
KeyTabInputStream, readName(): HTTP
KeyTabInputStream, readName(): kerbwebserv.realm.com
principal's key obtained from the keytab principal is HTTP/kerbwebserv.realm.com@REALM.COM
EType: sun.security.krb5.internal.crypto.DesCbcMd5EType
KrbAsReq calling createMessage
KrbAsReq in createMessage
KrbAsReq etypes are: 1
KrbKdcReq send: kdc=137.223.232.22, port=88, timeout=60000, number of retries =3, #bytes=245
KrbKdcReq send: #bytes read=1327
EType: sun.security.krb5.internal.crypto.DesCbcCrcEType
crc32: 36da72b6
crc32: 110110110110100111001010110110
KrbAsRep cons in KrbAsReq.getReply HTTP/kerbwebserv.realm.com
Added server's keyKerberos Principal HTTP/kerbwebserv.realm.com@REALM.COMKey Version 1key EncryptionKey: keyType=3 keyBytes (hex dump)= 0000: 52 7F 15 EA 1F C4 98 76 [Krb5LoginModule] added Krb5Principal HTTP/kerbwebserv.realm.com@REALM.COM to Subject Commit Succeeded jcifs.spnego.AuthenticationException: Error performing Kerberos authentication: java.lang.reflect.InvocationTargetException at jcifs.spnego.Authentication.processKerberos(Authentication.java:447) at jcifs.spnego.Authentication.processSpnego(Authentication.java:346) at jcifs.spnego.Authentication.process(Authentication.java:235) at jcifs.http.Negotiate.authenticate(Negotiate.java:46) at jcifs.http.AuthenticationFilter.doFilter(AuthenticationFilter.java:192) at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20) at uk.co.company.eng.j2ee.crm.filter.LoginFilter.doFilter(LoginFilter.java:97) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:598) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:308) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:779) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:264) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:107) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) at java.lang.Thread.run(Thread.java:536) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at jcifs.spnego.Authentication$ServerAction.run(Authentication.java:517) at jcifs.spnego.Authentication.processKerberos(Authentication.java:430) ... 13 more Caused by: GSSException: Failure unspecified at GSS-API level (Mechanism level: KDC has no support for encryption type (14)) at sun.security.jgss.krb5.Krb5Context.acceptSecContext(Krb5Context.java:599) at sun.security.jgss.GSSContextImpl.acceptSecContext(GSSContextImpl.java:300) at sun.security.jgss.GSSContextImpl.acceptSecContext(GSSContextImpl.java:246) ... 19 more

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 1 2005
Added on Jan 31 2005
3 comments
1,244 views