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连接? –