Categories: IT

node.jsで暗号化通信のSQLSERVERに接続する場合

SQLSERVERで通信を暗号化にしている場合、

node.jsから普通に接続を試みてもエラーにすらならず接続できない。

ネットで転がっている下記コードの9行目。

コメントではAzure用と書かれてるけど、これが暗号化なのでこの1行があればOK。


var mssql = require('mssql');
var config = {
  user: '.....',
  password: '.....',
  server: '.....', // You can use 'localhost\\instance' to connect to named instance
  database: '.....',

  options: {
    encrypt: true // Use this if you're on Windows Azure
  }
}

var connection = new sql.Connection(config, function(err) {
...
});
管理者

Recent Posts

Androidにて「Cookieが無効です 」が出る

AndroidスマホのChro…

2か月 ago

GASで半角カナから全角カナへ変換

Googleスプレッドシートに…

3か月 ago

This website uses cookies.