From 52d715676c6c12e7246ede22adb9dcf062dbaed4 Mon Sep 17 00:00:00 2001 From: Krittanan Pingclasai Date: Mon, 20 Nov 2017 16:14:38 +0700 Subject: [PATCH] string is an acceptable type of ssl attr --- types/mysql/index.d.ts | 3 ++- types/mysql/mysql-tests.ts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/mysql/index.d.ts b/types/mysql/index.d.ts index 7260dc2e85..7d3281218f 100644 --- a/types/mysql/index.d.ts +++ b/types/mysql/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/mysqljs/mysql // Definitions by: William Johnston // Kacper Polak +// Krittanan Pingclasai // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -422,7 +423,7 @@ export interface ConnectionConfig extends ConnectionOptions { /** * object with ssl parameters or a string containing name of ssl profile */ - ssl?: tls.SecureContextOptions & { rejectUnauthorized?: boolean }; + ssl?: string | (tls.SecureContextOptions & { rejectUnauthorized?: boolean }); } export interface PoolConfig extends ConnectionConfig { diff --git a/types/mysql/mysql-tests.ts b/types/mysql/mysql-tests.ts index a708aa6163..a3ddb27248 100644 --- a/types/mysql/mysql-tests.ts +++ b/types/mysql/mysql-tests.ts @@ -39,6 +39,11 @@ connection.query('SELECT 1', (err, rows) => { // connected! (unless `err` is set) }); +connection = mysql.createConnection({ + host: 'localhost', + ssl: 'Amazon RDS' +}); + connection = mysql.createConnection({ host: 'localhost', ssl: {