Skip to content

Conversation

durran
Copy link
Member

@durran durran commented Feb 4, 2022

Description

Updates CANONICALIZE_HOST_NAME options to accept true, false, "none", "forward", "forwardAndReverse".

What is changing?

When canonicalizing the host name when using GSSAPI, the driver will now behave as follows for these values:

  • true or "forwardAndReverse": Performs a forward DNS lookup of the host and a reverse lookup of the IP address to obtain the hostname. If the reverse lookup fails the driver falls back to a cname lookup.
  • "forward": Performs a cname lookup of the host.
  • false or "none": Does no hostname canonicalization.

When syncing the spec tests some other auth spec tests we hadn't synced yet were there, so I decided to leave them and skip the single failure.

This PR is branched off #3123 so needs to go in/be reviewed after that.

Is there new documentation needed for these changes?

None

What is the motivation for this change?

DRIVERS-1803 / NODE-2939

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

function resolveCname(host: string, callback: Callback<string>): void {
// Attempt to resolve the host name
dns.resolveCname(host, (err, r) => {
if (err) return callback(err);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also be

Suggested change
if (err) return callback(err);
if (err) return callback(undefined, host);

because Node.js gives you ENODATA errors for domains which exist but have no CNAME records attached

@durran durran closed this Feb 4, 2022
@durran durran deleted the NODE-2939 branch February 4, 2022 13:24
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

Successfully merging this pull request may close these issues.

2 participants