From d523eb9c40889d476f919b523dc3c67b245826c8 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 17 Feb 2017 15:00:20 -0800 Subject: tls: use emitWarning() for dhparam < 2048 bits When a dhparam less than 2048 bits was used, a warning was being printed directly to console.error using an internalUtil.trace function that was not used anywhere else. This replaces it with a proper process warning and removes the internalUtil.trace function. PR-URL: https://github.com/nodejs/node/pull/11447 Reviewed-By: Shigeki Ohtsu Reviewed-By: Ben Noordhuis Reviewed-By: Rod Vagg --- lib/_tls_common.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/_tls_common.js') diff --git a/lib/_tls_common.js b/lib/_tls_common.js index 107c3bb2ea..56baf7bde8 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -1,6 +1,5 @@ 'use strict'; -const internalUtil = require('internal/util'); const tls = require('tls'); const SSL_OP_CIPHER_SERVER_PREFERENCE = @@ -99,7 +98,7 @@ exports.createSecureContext = function createSecureContext(options, context) { if (options.dhparam) { const warning = c.context.setDHParam(options.dhparam); if (warning) - internalUtil.trace(warning); + process.emitWarning(warning, 'SecurityWarning'); } if (options.crl) { -- cgit v1.2.3