Ask questionsNode.js 12.10 throwing EPROTO on HTTPS request
<!-- Thank you for reporting a possible bug in Node.js.
Please fill in as much of the template below as you can.
Version: output of node -v
Platform: output of uname -a
(UNIX), or version and 32 or 64-bit (Windows)
Subsystem: if known, please specify the affected core module name
If possible, please provide code that demonstrates the problem, keeping it as simple and free of external dependencies as you can. -->
Code that was working previously in Node 11.12 (docker: node:11.12.0-stretch
) is failing with a SSL error in Node 12.10 (docker: node:12.10.0-buster
)
I've narrowed it down to this piece of code that reproduces the issue under Node 12.10.0 (but works fine in Node 11.12.0):
const https = require('https')
const options = { hostname: 'americas.universal-api.travelport.com', port: 443, path: '/B2BGateway/connect/uAPI/HotelService', method: 'POST', headers: { 'Content-Type': 'application/xml', 'Content-Length': '0' } }
https.request(options, res => {}).on('error', err => console.error('ERR', err))
Which produces the following output:
> ERR [Error: 140508230993792:error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature type:../deps/openssl/openssl/ssl/t1_lib.c:1110:
] {
library: 'SSL routines',
function: 'tls12_check_peer_sigalg',
reason: 'wrong signature type',
code: 'ERR_SSL_WRONG_SIGNATURE_TYPE'
}
FWIW, the exact same code works fine in Debian Stretch (docker: node:12.10.0-stretch
)
node:10.12.0-buster
)uname -a:
root@09b304d90ae0:/var/app# uname -a
Linux 09b304d90ae0 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 GNU/Linux
node -v:
root@09b304d90ae0:/var/app# node -v
v12.10.0
Full Stack trace:
Error: write EPROTO 140650779117440:error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature type:../deps/openssl/openssl/ssl/t1_lib.c:1110:
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:87:16)
From previous event:
at TravelportSOAPClient._callService (/var/app/src/services/api/requests/baseSoapClient.js:256:28)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at TravelportSOAPClient.request (/var/app/src/services/api/requests/baseSoapClient.js:229:12)
at roomRates (/var/app/src/services/api/handlers/hotels.js:220:16)
at getResponse (/var/app/src/services/api/index.js:77:10)
at Object.exports.runQuery (/var/app/src/services/api/index.js:105:22)
at Object.getTpHotelRates [as tp] (/var/app/src/app/search/collectors/hotel.js:681:24)
at /var/app/src/app/search/collectors/hotel.js:1341:9
<!-- Please provide more details below this comment. -->
Answer
questions
bnoordhuis
Doesn't seem like a bug to me - if it worked without .end()
before v12.x, that was by accident. It was never the documented behavior.
@mscdex @sam-github Do you concur? Can this be closed?
Related questions