Skip to content

Commit a6c6c1e

Browse files
committed
added -trustServerCertificate = true (or equivalent) to all connections
1 parent 99df60d commit a6c6c1e

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

Build/tSQLt.validatebuild.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@
451451
<echo message=" +----> outputfile: ${execute.sql.outputfile}" />
452452
<echo message=" +----> executeas: ${execute.sql.executeas}" />
453453
<echo message=" +----> sqlconnect: ${execute.sql.sqlconnect}" />
454-
<property name="execute.sql.sqlcmd" value="&quot;${sqlcmd.path}&quot;\sqlcmd ${execute.sql.sqlconnect} -I -i &quot;${execute.sql.executeas}&quot; ${execute.sql.filename} -v NewDbName=${execute.sql.newDatabase} DbName=${execute.sql.database} BuildLogTableName=&quot;${logtable.name}&quot; ExecuteStatement=&quot;${execute.sql.statement}&quot; -V11" />
454+
<property name="execute.sql.sqlcmd" value="&quot;${sqlcmd.path}&quot;\sqlcmd ${execute.sql.sqlconnect} -I -i &quot;${execute.sql.executeas}&quot; ${execute.sql.filename} -v NewDbName=${execute.sql.newDatabase} DbName=${execute.sql.database} BuildLogTableName=&quot;${logtable.name}&quot; ExecuteStatement=&quot;${execute.sql.statement}&quot; -V11 -C" />
455455
<echo message="${execute.sql.sqlcmd}" />
456456
<condition property="execute.sql.statement_or_file.output.tofile">
457457
<not>

CI/Azure-DevOps/AZ_MainPipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ stages:
195195
inputs:
196196
targetType: 'inline'
197197
script: |
198-
$DS = Invoke-Sqlcmd -Query "SELECT SUSER_NAME() U,SYSDATETIME() T,@@VERSION V;" -ServerInstance "$(CreateSQLVMEnvironment.FQDNAndPort)" -Username "$(CreateSQLVMEnvironment.SQLUserName)" -Password "$(CreateSQLVMEnvironment.SQLPwd)" -As DataSet
198+
$DS = Invoke-Sqlcmd -Query "SELECT SUSER_NAME() U,SYSDATETIME() T,@@VERSION V;" -ServerInstance "$(CreateSQLVMEnvironment.FQDNAndPort)" -Username "$(CreateSQLVMEnvironment.SQLUserName)" -Password "$(CreateSQLVMEnvironment.SQLPwd)" -As DataSet -TrustServerCertificate
199199
$DS.Tables[0].Rows | %{ echo "{ $($_['U']), $($_['T']), $($_['V']) }" }
200200
201201

CI/Azure-DevOps/CreateSQLVM_azcli.ps1

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,6 @@ if (!$output) {
177177
$SQLVM|Out-String|Log-Output;
178178
Log-Output 'DONE: Applying SqlVM Config'
179179

180-
# Log-Output 'START: Getting SQL Server Certificate'
181-
# & openssl s_client -connect "$FQDN`:$SQLPort" -showcerts </dev/null 2>/dev/null | openssl x509 -outform PEM > "Connection_Certificate_$VMName.pem"
182-
# $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("Connection_Certificate_$VMName.pem")
183-
# $store = New-Object System.Security.Cryptography.X509Certificates.X509Store([System.Security.Cryptography.X509Certificates.StoreName]::TrustedPeople, 'LocalMachine')
184-
# $store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite)
185-
# $store.Add($cert)
186-
# $store.Close()
187-
188180
Log-Output 'START: Prep SQL Server for tSQLt Build'
189181
$DS = Invoke-Sqlcmd -InputFile "$dir/GetSQLServerVersion.sql" -ServerInstance "$FQDN,$SQLPort" -Username "$SQLUserName" -Password "$SQLPwd" -As DataSet -TrustServerCertificate
190182
$DS.Tables[0].Rows | %{ Log-Output "{ $($_['LoginName']), $($_['TimeStamp']), $($_['VersionDetail']), $($_['ProductVersion']), $($_['ProductLevel']), $($_['SqlVersion']), $($_['ServerCollation']) }" }

0 commit comments

Comments
 (0)