Skip to content

The connection string include "Host Name In Certificate=MYSQLSERVER" when I select encryption "Optional" #1467

@Memoi

Description

@Memoi

Problem description

With the last version 5.7.0 I set the value "DatabaseConnectionEncryption" to "Optional", the value "DatabaseServerCertificateHostName" with the same value than the CN of my SQL certificate.

When I enable the Session State with Enable-SPSessionStateService –DefaultProvision I have a new line in web.config of all Web App with a connectionstring who contains "Host Name In Certificate=MYSQLSERVER" and with this parameter I have an error 500, if I remove it it's working well but a timer job will re-add it.

If I create a farm with the GUI when I select "Optional" for the encryption I can't set a Database Server for the Certificate Host name then in connection string I don't have the part "Host Name In Certificate=MYSQLSERVER"

Verbose logs

Windows Event Id 1310 : 
    Exception message: Error parsing <sessionState> sqlConnectionString attribute: Keyword not supported: 'host name in certificate'.

DSC configuration

.

Suggested solution

Allow blank value for DatabaseServerCertificateHostName if DatabaseConnectionEncryption is Optional.
[ValidateNotNullOrEmpty()] must be removed for $DatabaseServerCertificateHostName parameter.

Replace line 344 by
if ($params.DatabaseConnectionEncryption -ne "Optional")
{
$returnValue.Add("DatabaseServerCertificateHostName", $ConnectionEncryption.DatabaseServerCertificateHostName)
}

I changed it in my server and now it's working well.

SharePoint version and build

SP SE with CU of October 2025

Operating system the target node is running

Windows 2022

PowerShell version and build the target node is running

.

SharePointDsc version

5.7.0

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