Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls: remove usage of public require('util') #26747

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@

'use strict';

require('internal/util').assertCrypto();
const {
assertCrypto,
deprecate
} = require('internal/util');

assertCrypto();

const assert = require('internal/assert');
const crypto = require('crypto');
const net = require('net');
const tls = require('tls');
const util = require('util');
const common = require('_tls_common');
const JSStreamSocket = require('internal/js_stream_socket');
const { Buffer } = require('buffer');
const debug = util.debuglog('tls');
const debug = require('internal/util/debuglog').debuglog('tls');
const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap');
const tls_wrap = internalBinding('tls_wrap');
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
Expand Down Expand Up @@ -370,7 +374,8 @@ function TLSSocket(socket, opts) {
// Read on next tick so the caller has a chance to setup listeners
process.nextTick(initRead, this, socket);
}
util.inherits(TLSSocket, net.Socket);
Object.setPrototypeOf(TLSSocket.prototype, net.Socket.prototype);
Object.setPrototypeOf(TLSSocket, net.Socket);
sam-github marked this conversation as resolved.
Show resolved Hide resolved
exports.TLSSocket = TLSSocket;

var proxiedMethods = [
Expand Down Expand Up @@ -924,7 +929,8 @@ function Server(options, listener) {
}
}

util.inherits(Server, net.Server);
Object.setPrototypeOf(Server.prototype, net.Server.prototype);
Object.setPrototypeOf(Server, net.Server);
exports.Server = Server;
exports.createServer = function createServer(options, listener) {
return new Server(options, listener);
Expand Down Expand Up @@ -1072,7 +1078,7 @@ Server.prototype.setTicketKeys = function setTicketKeys(keys) {
};


Server.prototype.setOptions = util.deprecate(function(options) {
Server.prototype.setOptions = deprecate(function(options) {
this.requestCert = options.requestCert === true;
this.rejectUnauthorized = options.rejectUnauthorized !== false;

Expand Down