Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSSAPIBindRequest duplicate() does not duplicate GSSAPIChannelBindingType #146

Open
gabesz84 opened this issue May 24, 2023 · 1 comment

Comments

@gabesz84
Copy link

I am trying to create an LDAPConnectionPool, but getting a connection always fails because the duplicated GSSAPIBindRequests have always set the GSSAPIChannelBindingType to NONE.

Suggested fix:
` /**

  • {@inheritdoc}
    */
    @OverRide()
    @NotNull()
    public GSSAPIBindRequest duplicate(@nullable final Control[] controls)
    {
    try
    {
    final GSSAPIBindRequestProperties gssapiProperties =
    new GSSAPIBindRequestProperties(authenticationID, authorizationID,
    password, realm, kdcAddress, configFilePath);
    gssapiProperties.setAllowedQoP(allowedQoP);
    gssapiProperties.setServicePrincipalProtocol(servicePrincipalProtocol);
    gssapiProperties.setUseTicketCache(useTicketCache);
    gssapiProperties.setRequireCachedCredentials(requireCachedCredentials);
    gssapiProperties.setRenewTGT(renewTGT);
    gssapiProperties.setRefreshKrb5Config(refreshKrb5Config);
    gssapiProperties.setUseKeyTab(useKeyTab);
    gssapiProperties.setKeyTabPath(keyTabPath);
    gssapiProperties.setUseSubjectCredentialsOnly(useSubjectCredentialsOnly);
    gssapiProperties.setTicketCachePath(ticketCachePath);
    gssapiProperties.setEnableGSSAPIDebugging(enableGSSAPIDebugging);
    gssapiProperties.setJAASClientName(jaasClientName);
    gssapiProperties.setSASLClientServerName(saslClientServerName);
    gssapiProperties.setIsInitiator(isInitiator);
    gssapiProperties.setSuppressedSystemProperties(
    suppressedSystemProperties);
    // Fix:
    gssapiProperties.setChannelBindingType(channelBindingType);

    final GSSAPIBindRequest bindRequest =
    new GSSAPIBindRequest(gssapiProperties, controls);
    bindRequest.setResponseTimeoutMillis(getResponseTimeoutMillis(null));
    return bindRequest;
    }
    catch (final Exception e)
    {
    // This should never happen.
    Debug.debugException(e);
    return null;
    }
    }`

@dirmgr
Copy link
Collaborator

dirmgr commented May 25, 2023

Thanks for reporting this. I have just committed a fix. I also added a GSSAPIBindRequest.getChannelBindingType method that can be used to retrieve the channel binding type for the bind request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants