mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
trust server certificate option #305
This commit is contained in:
parent
1a90729f66
commit
755781bca6
@ -168,6 +168,10 @@
|
|||||||
<FormCheckboxField label="Is read only" name="isReadOnly" disabled={isConnected} />
|
<FormCheckboxField label="Is read only" name="isReadOnly" disabled={isConnected} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
{#if driver?.showConnectionField('trustServerCertificate', $values)}
|
||||||
|
<FormCheckboxField label="Trust server certificate" name="trustServerCertificate" disabled={isConnected} />
|
||||||
|
{/if}
|
||||||
|
|
||||||
{#if driver?.showConnectionField('defaultDatabase', $values)}
|
{#if driver?.showConnectionField('defaultDatabase', $values)}
|
||||||
<FormTextField label="Default database" name="defaultDatabase" disabled={isConnected} />
|
<FormTextField label="Default database" name="defaultDatabase" disabled={isConnected} />
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -22,7 +22,7 @@ function extractTediousColumns(columns, addDriverNativeColumn = false) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function tediousConnect({ server, port, user, password, database, ssl }) {
|
async function tediousConnect({ server, port, user, password, database, ssl, trustServerCertificate }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const connectionOptions = {
|
const connectionOptions = {
|
||||||
encrypt: !!ssl,
|
encrypt: !!ssl,
|
||||||
@ -32,6 +32,7 @@ async function tediousConnect({ server, port, user, password, database, ssl }) {
|
|||||||
validateBulkLoadParameters: false,
|
validateBulkLoadParameters: false,
|
||||||
requestTimeout: 1000 * 3600,
|
requestTimeout: 1000 * 3600,
|
||||||
port: port ? parseInt(port) : undefined,
|
port: port ? parseInt(port) : undefined,
|
||||||
|
trustServerCertificate: !!trustServerCertificate,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (database) {
|
if (database) {
|
||||||
|
@ -126,7 +126,8 @@ const driver = {
|
|||||||
showConnectionField: (field, values) =>
|
showConnectionField: (field, values) =>
|
||||||
['authType', 'server', 'port', 'user', 'password', 'defaultDatabase', 'singleDatabase', 'isReadOnly'].includes(
|
['authType', 'server', 'port', 'user', 'password', 'defaultDatabase', 'singleDatabase', 'isReadOnly'].includes(
|
||||||
field
|
field
|
||||||
),
|
) ||
|
||||||
|
(field == 'trustServerCertificate' && values.authType != 'sql' && values.authType != 'sspi'),
|
||||||
getQuerySplitterOptions: () => mssqlSplitterOptions,
|
getQuerySplitterOptions: () => mssqlSplitterOptions,
|
||||||
|
|
||||||
engine: 'mssql@dbgate-plugin-mssql',
|
engine: 'mssql@dbgate-plugin-mssql',
|
||||||
|
Loading…
Reference in New Issue
Block a user