Skip to content

Commit c571e46

Browse files
authored
fix: always authorize TLS endpoints, use servername for SNI (#159)
TLS endpoints should always be authorized. In order to properly communicate with GCP's KMS servers we need to provide a `servername`, so the endpoint can serve the correct TLS certificate.
1 parent 99e8c8c commit c571e46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/stateMachine.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ module.exports = function(modules) {
217217
kmsRequest(request) {
218218
const parsedUrl = request.endpoint.split(':');
219219
const port = parsedUrl[1] != null ? Number.parseInt(parsedUrl[1], 10) : HTTPS_PORT;
220-
const options = { host: parsedUrl[0], port, rejectUnauthorized: false };
220+
const options = { host: parsedUrl[0], servername: parsedUrl[0], port };
221221
const message = request.message;
222222

223223
return new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)