Skip to content

Error: The target principal name is incorrect #1621

Closed

Description

@jogibear9988

Describe the bug

We have a Net6 Programm wich throws this error (In German: "Der Zielprinzipalname ist falsch").

If we you the same software in an older Version wich works with Net4.8 and System.Data.SqlServer the same connection String could access the Database.
Also Managementstudio could access the DB.

We use "Integrated Security=true" to access the Database.

We also tried to add: encrypt=false to the connection string.

MicrosoftTeams-image

Activity

  1. changed the title [-]Error: TargetPricipal is wrong [/-] [+]Error: Target Principal is wrong[/+] on May 24, 2022
  2. changed the title [-]Error: Target Principal is wrong[/-] [+]Error: The target principal name is incorrect[/+] on May 24, 2022
  3. jogibear9988 commented on May 24, 2022

    @jogibear9988
    Author

    Got it fixed via adding:
    Trust Server Certificate = true;
    to ConnectionString

    see:
    #609 (comment)

  4. JRahnama commented on May 25, 2022

    @JRahnama
    Contributor

    @jogibear9988 thanks for bringing the issue up to our attention. If the problem is solved please feel free to close it.

  5. JRahnama commented on May 27, 2022

    @JRahnama
    Contributor

    @jogibear9988 is server setup to force encryption with a self-signed certificate? Starting in M.D.S 4.0, the driver will validate server certificates based on the Trust Server Certificate setting when encryption is negotiated by Encrypt=true OR if the server requires encryption. If that is your scenario, you can either install the server certificate on the client as a trusted certificate (most secure) or set Trust Server Certificate=true (less secure because it will trust ANY certificate).

  6. jogibear9988 commented on May 29, 2022

    @jogibear9988
    Author

    @JRahnama Don't know... I only know, it worked with the connection sring in net4.8
    And it now works after adding: "Trust Server Certificate=true"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions