当在服务器上独立运行时,我有一个NodeJS应用程序运行得很好。当我在码头容器中运行它时,它会显示以下错误消息:
ConnectionError:未能连接到TEXTREPLACED:未定义-套接字挂起
在/app/node_modules/mssql/lib/tedious/connection-pool.js:71:17
在(/app/node_modules/tedious/lib/connection.js:1037:9) Connection.onConnect
在Object.onceWrapper (节点:事件:514:26)
在Connection.emit (节点:事件:394:28)
在(/app/node_modules/tedious/lib/connection.js:1065:18) Connection.emit
在(/app/node_modules/tedious/lib/connection.js:1663:12) Connection.socketError
在(/app/node_modules/tedious/lib/connection.js:1693:12) Connection.socketEnd
在插座上。(/app/node_modules/tedious/lib/connection.js:1433:14)
在Socket.emit (节点:事件:406:35)
在endReadableNT (节点:内部/流/可读性:1331:12){
密码:“ESOCKET”,
originalError: ConnectionError:未能连接到TEXTREPLACED:未定义-套接字挂起
在(/app/node_modules/tedious/lib/errors.js:13:12) ConnectionError
在(/app/node_modules/tedious/lib/connection.js:1663:56) Connection.socketError
在(/app/node_modules/tedious/lib/connection.js:1693:12) Connection.socketEnd
在插座上。(/app/node_modules/tedious/lib/connection.js:1433:14)
在Socket.emit (节点:事件:406:35)
在endReadableNT (节点:内部/流/可读性:1331:12)
在processTicksAndRejections (节点:内部/进程/任务队列:83:21){
代码:“ESOCKET”
}
}
我的连接代码是:
const sqlConfig = {
user: 'LOGIN',
password: 'PASSWORD',
server: 'SERVER\\INSTANCE',
database: 'DATABASE',
debug:true,
port: 1433,
driver:'tedious',
pool:{
idleTimeoutMillis: 1000
},
options:{
port:1433,
enableArithAbort:true,
encrypt:true,
trustServerCertificate:true,
instanceName:'INSTANCE',
database:'DATABASE',
debug:{
packet: true,
data:true,
payload:true,
token:true,
log:true
}
}
};
const global_pool = new sql.ConnectionPool(sqlConfig);
var global_pool_con = null;
try {
global_pool_con = global_pool.connect();
}catch{
console.log(err);
}Dockerfile
# Use Node base image
FROM node:latest
#ports
EXPOSE 3000
EXPOSE 1433
WORKDIR /app
COPY package.json /app
RUN npm install
COPY . /app
USER node
CMD [run, script, release]"release“脚本运行初始的js文件。
令人困惑的是,错误显示的是“未定义”,而不是端口号。我已经使用主机和桥接器连接端口1433和3000 (HAPI)路由,并确认端口公开在dockerfile中。
考虑到它的工作时,独立,我是假设一个码头设置在某个地方,它是造成问题。
更新: TLS/SSL协商包正在发送,但未收到
State change: SentPrelogin -> SentTLSSSLNegotiation更新:当被篡改的应用程序试图连接时,Server将在事件日志中显示此错误。
A fatal alert was generated and sent to the remote endpoint. This may result in termination of the connection. The TLS protocol defined fatal error code is 40. The Windows SChannel error state is 1205.
An TLS 1.2 connection request was received from a remote client application, but none of the cipher suites supported by the client application are supported by the server. The SSL connection request has failed.发布于 2021-08-18 15:41:44
感谢大家的帮助。
解决这个问题的方法是更新openSSL.cnf文件,它在源映像中有额外的行,而这些行并不是必需的。
https://stackoverflow.com/questions/68820641
复制相似问题