1
0
Fork 0
mirror of synced 2024-08-11 08:01:42 +12:00

Fix for #5530 - make MySQL RejectUnauthorized SSL parameter accessible to the user.

This commit is contained in:
mike12345567 2022-04-22 14:53:36 +01:00
parent 9b20daf930
commit d36fc9c7ba

View file

@ -27,7 +27,8 @@ module MySQLModule {
user: string user: string
password: string password: string
database: string database: string
ssl?: object ssl?: { [key: string]: any }
rejectUnauthorized: boolean
} }
const SCHEMA: Integration = { const SCHEMA: Integration = {
@ -65,6 +66,11 @@ module MySQLModule {
type: DatasourceFieldTypes.OBJECT, type: DatasourceFieldTypes.OBJECT,
required: false, required: false,
}, },
rejectUnauthorized: {
type: DatasourceFieldTypes.BOOLEAN,
default: true,
required: false,
},
}, },
query: { query: {
create: { create: {
@ -114,6 +120,16 @@ module MySQLModule {
if (config.ssl && Object.keys(config.ssl).length === 0) { if (config.ssl && Object.keys(config.ssl).length === 0) {
delete config.ssl delete config.ssl
} }
// make sure this defaults to true
if (
config.rejectUnauthorized != null &&
!config.rejectUnauthorized &&
config.ssl
) {
config.ssl.rejectUnauthorized = config.rejectUnauthorized
}
// @ts-ignore
delete config.rejectUnauthorized
this.config = config this.config = config
} }