string is an acceptable type of ssl attr

This commit is contained in:
Krittanan Pingclasai
2017-11-20 16:14:38 +07:00
parent a4c2d3c7de
commit 52d715676c
2 changed files with 7 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
// Project: https://github.com/mysqljs/mysql
// Definitions by: William Johnston <https://github.com/wjohnsto>
// Kacper Polak <https://github.com/kacepe>
// Krittanan Pingclasai <https://github.com/kpping>
// 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 {

View File

@@ -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: {