• Home
  • About
    • lahuman photo

      lahuman

      열심히 사는 아저씨

    • Learn More
    • Facebook
    • LinkedIn
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

Node] Sequelize에서 MSSQL 연동시 RFC 6066 오류 해결 방법

26 Jun 2020

Reading time ~1 minute

Node] Sequelize에서 MSSQL 연동시 RFC 6066 오류 해결 방법

Sequlize 에서 MSSQL을 연동할때 드라이버로 tedious@^6.0.0 이상을 사용하라고 가이드 합니다.

설치해서 DBMS에 접근했을때, 다음과 같은 오류가 발생하면,

(node:95610) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
(Use node --trace-deprecation ... to show where the warning was created)
(node:95610) UnhandledPromiseRejectionWarning: SequelizeConnectionError: Failed to connect to IPADDRESS:1433 - 4438633920:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:../deps/openssl/openssl/ssl/statem/statem_lib.c:1942:

db연결 옵션에 encrypt: false을 추가 하면 됩니다.

"use static";

const Sequelize = require("sequelize");

const mssqlDB = new Sequelize(
  process.env.HOMENET_MSSQL_DB,
  process.env.HOMENET_MSSQL_USER,
  process.env.HOMENET_MSSQL_PASS,
  {
    host: process.env.HOMENET_MSSQL_URL,
    port: process.env.HOMENET_MSSQL_PORT || "1433",
    dialect: "mssql",
    dialectOptions: {
      options: {
        useUTC: false,
        dateFirst: 1,
        encrypt: false, // 오류 발생시 추가 한 부분!
      },
    },
    pool: {
      max: 5,
      min: 0,
      acquire: 30000,
      idle: 10000,
    },
    define: {
      // The `timestamps` field specify whether or not the `createdAt` and `updatedAt` fields will be created.
      // This was true by default, but now is false by default
      timestamps: false,
      supportBigNumbers: true,
    },
  }
);

module.exports = {
    mssqlDB
};

이렇게 하면 문제없이 조회가 됩니다!!

참고자료

  • Dialects
  • DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. #884


expresstedioussequelize Share Tweet +1