Skip to content

Notes on Connection Strings When Using SQL Server as the Database in Pleasanter 1.5 and Later

Overview

Starting with .NET 10, which is used in Pleasanter 1.5 and later, TLS certificate verification for SQL Server connections is now enabled by default.

As a result of this change, connections may fail if the target SQL Server does not present a valid TLS certificate. In .NET 8, which is used in Pleasanter 1.4 and earlier, TLS certificate verification was disabled by default, allowing connections to SQL Servers without certificate configuration. However, Pleasanter 1.5 and later require one of the following approaches:

Solutions

  1. Configure a TLS certificate on SQL Server
  2. Add TrustServerCertificate=true; to the connection string

This page explains option 2 for users who cannot immediately configure TLS certificates.

Instructions

1. When Configured in Rds.json

Rds.json Before Editing (relevant sections only)
    "SaConnectionString": "Server=(local);Database=master;UID=sa;PWD={*1};Connection Timeout=30;",
    "OwnerConnectionString": "Server=(local);Database=#ServiceName#;UID=#ServiceName#_Owner;PWD={*2};Connection Timeout=30;",
    "UserConnectionString": "Server=(local);Database=#ServiceName#;UID=#ServiceName#_User;PWD={*3};Connection Timeout=30;",
Rds.json After Editing (relevant sections only)

    "SaConnectionString": "Server=(local);Database=master;UID=sa;PWD={*1};Connection Timeout=30;TrustServerCertificate=true;",
    "OwnerConnectionString": "Server=(local);Database=#ServiceName#;UID=#ServiceName#_Owner;PWD={*2};Connection Timeout=30;TrustServerCertificate=true;",
    "UserConnectionString": "Server=(local);Database=#ServiceName#;UID=#ServiceName#_User;PWD={*3};Connection Timeout=30;TrustServerCertificate=true;",

{*1} SA account password
{*2}, {*3} Arbitrary passwords

2. When Configured with System Environment Variables

Add "TrustServerCertificate=true;" to the end of the value for each of the following system variables:

  1. Implem.Pleasanter_Rds_SQLServer_OwnerConnectionString
  2. Implem.Pleasanter_Rds_SQLServer_SaConnectionString
  3. Implem.Pleasanter_Rds_SQLServer_UserConnectionString

Meaning of Adding TrustServerCertificate=true;

When you add TrustServerCertificate=true; to the connection string, the client side does not verify the SQL Server's certificate chain (trusting the server certificate), and the connection will always succeed (except when there are issues other than encryption).

If a server certificate is not implemented, this may leave the system vulnerable to man-in-the-middle attacks and other threats. Use should be limited to:

  1. Local servers
  2. Development servers

Or other restricted environments.

Please also refer to Microsoft's documentation.

Installation

Version Upgrade