Skip to content

Connect-DbaInstance - Trust server certificate for localhost DAC connections#10263

Merged
potatoqualitee merged 1 commit into
developmentfrom
claude/issue-10254-20260318-1316
Mar 18, 2026
Merged

Connect-DbaInstance - Trust server certificate for localhost DAC connections#10263
potatoqualitee merged 1 commit into
developmentfrom
claude/issue-10254-20260318-1316

Conversation

@andreasjordan
Copy link
Copy Markdown
Collaborator

Fixes #10254

When using DedicatedAdminConnection with a localhost instance, the server name is changed to ADMIN:localhost to avoid multi-IP resolution issues (#10151). However, if TLS encryption is enabled, the SQL Server certificate (issued to the FQDN) doesn't match localhost, causing "The target principal name is incorrect".

Automatically set TrustServerCertificate=true when connecting via DAC to localhost, since the hostname mismatch is expected and acceptable in this context.

Generated with Claude Code

…ections

When using DedicatedAdminConnection with a localhost instance, the server name
is changed to 'ADMIN:localhost' to avoid multi-IP resolution issues (#10151).
However, if TLS encryption is enabled, the SQL Server certificate (issued to the
FQDN, e.g., 'r9d9.pup.local') doesn't match 'localhost', causing the error
'The target principal name is incorrect' (#10254).

Automatically set TrustServerCertificate=true when connecting via DAC to
localhost, since the hostname mismatch is expected and acceptable in this context.
Applies to both the String input path and the Server/copyContext path.

(do *Connect*)

Co-authored-by: Andreas Jordan <andreasjordan@users.noreply.github.com>
@andreasjordan andreasjordan marked this pull request as ready for review March 18, 2026 15:03
@potatoqualitee
Copy link
Copy Markdown
Member

interesting, thank you 😎

@potatoqualitee potatoqualitee merged commit 3d6fa11 into development Mar 18, 2026
15 of 16 checks passed
@potatoqualitee potatoqualitee deleted the claude/issue-10254-20260318-1316 branch March 18, 2026 23:04
potatoqualitee added a commit that referenced this pull request Apr 10, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Export-DbaLinkedServer broken in 2.7.26

2 participants