Kerberos - 如何设置超时和重试次数配置参数?

Kerberos - How are timeout and number of retries configuration parameters set?

我的应用程序通过 Active Directory Kerberos 对用户进行身份验证。我正在使用 kerb4j,https://github.com/bedrin/kerb4j,它最终使用 sun.security.krb5 代码。当我的应用程序尝试身份验证时,我在标准输出中看到以下内容(在指定 VM arg sun.security.krb5.debug=true 之后):

>>> KrbKdcReq send: kdc=server123.myserver.com. UDP:88, timeout=30000, number of retries =3, #bytes=1542
>>> KDCCommunication: kdc=server123.myserver.com. UDP:88, timeout=30000,Attempt=1, #bytes=1542
SocketTimeOutException with attempt: 1
>>> KDCCommunication: kdc=server123.myserver.com. UDP:88, timeout=30000,Attempt=2, #bytes=1542
SocketTimeOutException with attempt: 2
>>> KDCCommunication: kdc=server123.myserver.com. UDP:88, timeout=30000,Attempt=3, #bytes=1542
SocketTimeOutException with attempt: 3

在哪里指定超时和重试次数?这是在 AD 服务器上指定的 KDC 属性 吗?是否可以在应用程序级别进行配置?如果可以,怎么做?

超时和重试次数 hard-coded 在应用程序服务器上的 GSSAPI 中,而不是在 Active Directory 中。 UDP 被路径上某处的防火墙阻止。只需让您的应用程序使用 TCP 端口而不是 UDP 与 Kerberos 通信。您可以通过在应用程序服务器上编辑 /etc/krb5.conf 来完成此操作:

[库默认值] udp_preference_limit =1