Fix issue with SQL Database Projects unable to connect due to default encryption (#21010)

This commit is contained in:
Cheena Malhotra
2022-11-01 09:26:37 -07:00
committed by GitHub
parent 2d5c168182
commit bb24eb29c5
3 changed files with 45 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ export class ConnectionService {
const azdataApi = utils.getAzdataApi();
const vscodeMssqlApi = azdataApi ? undefined : await utils.getVscodeMssqlApi();
if (azdataApi) {
// TODO receive encrypt/trustservercertificate from profile.
const connectionProfile = {
password: profile.password,
serverName: `${profile.serverName},${profile.port}`,
@@ -42,7 +43,10 @@ export class ConnectionService {
saveProfile: false,
id: '',
connectionName: profile.profileName,
options: [],
options: {
'encrypt': true,
'trustServerCertificate': true
},
authenticationType: azdataApi.connection.AuthenticationType.SqlLogin
};
return await azdataApi.connection.connect(connectionProfile, saveConnectionAndPassword, false);