Jus*_*tin 5 apache kerberos aes spnego
我有一个带有 Spnego SSO 设置的 tomcat 服务器,它运行良好,没有任何问题。现在我想在它前面添加一个 Apache 服务器以启用 SSL。Apache服务器使用AJP与其通信:
<VirtualHost *:58443>
SSLEngine on
ServerName ca09417d.global.local:58443
SSLCertificateFile "${SRVROOT}/conf/ssl/ca09417d.server.cer"
SSLCertificateKeyFile "${SRVROOT}/conf/ssl/ca09417d.server.key"
...
ProxyRequests off
ProxyPreserveHost On
ProxyPass /vcaps3 ajp://cavcdbdev02:58009/vcaps3
ProxyPassReverse /vcaps3 ajp://cavcdbdev02:58009/vcaps3
</virtualhost>
Run Code Online (Sandbox Code Playgroud)
之后,服务器抱怨这个错误:
KrbException: Invalid argument (400) - Cannot find key of appropriate type to decrypt AP REP - AES256 CTS mode with HMAC SHA1-96
sun.security.krb5.KrbApReq.authenticate(KrbApReq.java:278)
sun.security.krb5.KrbApReq.<init>(KrbApReq.java:149)
sun.security.jgss.krb5.InitSecContextToken.<init>(InitSecContextToken.java:108)
sun.security.jgss.krb5.Krb5Context.acceptSecContext(Krb5Context.java:829)
sun.security.jgss.GSSContextImpl.acceptSecContext(GSSContextImpl.java:342)
sun.security.jgss.GSSContextImpl.acceptSecContext(GSSContextImpl.java:285)
sun.security.jgss.spnego.SpNegoContext.GSS_acceptSecContext(SpNegoContext.java:906)
sun.security.jgss.spnego.SpNegoContext.acceptSecContext(SpNegoContext.java:556)
sun.security.jgss.GSSContextImpl.acceptSecContext(GSSContextImpl.java:342)
sun.security.jgss.GSSContextImpl.acceptSecContext(GSSContextImpl.java:285)
net.sourceforge.spnego.SpnegoAuthenticator.doSpnegoAuth(SpnegoAuthenticator.java:444)
net.sourceforge.spnego.SpnegoAuthenticator.authenticate(SpnegoAuthenticator.java:283)
net.sourceforge.spnego.SpnegoHttpFilter.doFilter(SpnegoHttpFilter.java:229)
Run Code Online (Sandbox Code Playgroud)
所以我尝试了这些事情:
spnego.allow.localhost =true
现在我不知道应该做什么来解决它。
这是我的 krb5.conf 的主要部分:
[libdefaults]
default_tkt_enctypes = rc4-hmac aes256-cts aes128-cts
default_tgs_enctypes = rc4-hmac aes256-cts aes128-cts
permitted_enctypes = rc4-hmac aes256-cts aes128-cts
Run Code Online (Sandbox Code Playgroud)
你可以帮帮我吗?
非常感谢!
贾斯汀
解决方案一:
我遇到了类似的错误,因为密钥表文件是使用错误的/crypto
配置生成的。
无法找到适当类型的密钥来使用 HMAC 解密 AP-REQ - RC4)
/crypto ALL
使用以下命令生成新的密钥表文件ktpass
:
ktpass /out "server.keytab" /crypto ALL /princ HTTP/server@REALM /mapuser KERBEROS_SERVICEUSER /pass PASSWORD /ptype KRB5_NT_PRINCIPAL
Run Code Online (Sandbox Code Playgroud)
将HTTP/server@REALM
,KERBEROS_SERVICEUSER
和替换PASSWORD
为相应的值。
解决方案2:
确保 Kerberos 服务用户选中了以下选项: