2
服務器在嘗試與Postgres的節點連接的js,衝進錯誤Knex:錯誤池2 - 錯誤:不支持SSL連接
Resource Wall is listening on port 8080
Knex:Error Pool2 - Error: The server does not support SSL connections
Knex:Error Pool2 - Error: The server does not support SSL connections
如何關閉SSL連接?這裏是我的環境設置
DB_HOST=localhost
DB_USER=postgres
DB_PASS=password
DB_NAME=dbname
DB_SSL=true if heroku
DB_PORT=5432
而且我knexfile.js
require('dotenv').config();
module.exports = {
development: {
client: 'postgresql',
connection: {
host : process.env.DB_HOST,
user : process.env.DB_USER,
password : process.env.DB_PASS,
database : process.env.DB_NAME,
port : process.env.DB_PORT,
ssl : process.env.DB_SSL
},
migrations: {
directory: './db/migrations',
tableName: 'migrations'
},
seeds: {
directory: './db/seeds'
}
},
production: {
client: 'postgresql',
connection: process.env.DATABASE_URL + '?ssl=true',
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'migrations'
}
}
};
因爲我在開發中運行,我預計它不會通過SSL。嘗試從對象和URL中刪除該SSL部分。沒有運氣。
如果你不加入任何弄虛作假,使SSL工作,knex不會嘗試用ssl連接連接postgres。你確定這是刪除配置的SSL部分後得到的錯誤嗎?你確定你正在使用該knexfile連接? –