|
21 | 21 |
|
22 | 22 | 'use strict';
|
23 | 23 |
|
24 |
| -require('internal/util').assertCrypto(); |
| 24 | +const { |
| 25 | + assertCrypto, |
| 26 | + deprecate |
| 27 | +} = require('internal/util'); |
| 28 | + |
| 29 | +assertCrypto(); |
25 | 30 |
|
26 | 31 | const assert = require('internal/assert');
|
27 | 32 | const crypto = require('crypto');
|
28 | 33 | const net = require('net');
|
29 | 34 | const tls = require('tls');
|
30 |
| -const util = require('util'); |
31 | 35 | const common = require('_tls_common');
|
32 | 36 | const JSStreamSocket = require('internal/js_stream_socket');
|
33 | 37 | const { Buffer } = require('buffer');
|
34 |
| -const debug = util.debuglog('tls'); |
| 38 | +const debug = require('internal/util/debuglog').debuglog('tls'); |
35 | 39 | const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap');
|
36 | 40 | const tls_wrap = internalBinding('tls_wrap');
|
37 | 41 | const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
|
@@ -393,7 +397,8 @@ function TLSSocket(socket, opts) {
|
393 | 397 | // Read on next tick so the caller has a chance to setup listeners
|
394 | 398 | process.nextTick(initRead, this, socket);
|
395 | 399 | }
|
396 |
| -util.inherits(TLSSocket, net.Socket); |
| 400 | +Object.setPrototypeOf(TLSSocket.prototype, net.Socket.prototype); |
| 401 | +Object.setPrototypeOf(TLSSocket, net.Socket); |
397 | 402 | exports.TLSSocket = TLSSocket;
|
398 | 403 |
|
399 | 404 | var proxiedMethods = [
|
@@ -985,7 +990,8 @@ function Server(options, listener) {
|
985 | 990 | }
|
986 | 991 | }
|
987 | 992 |
|
988 |
| -util.inherits(Server, net.Server); |
| 993 | +Object.setPrototypeOf(Server.prototype, net.Server.prototype); |
| 994 | +Object.setPrototypeOf(Server, net.Server); |
989 | 995 | exports.Server = Server;
|
990 | 996 | exports.createServer = function createServer(options, listener) {
|
991 | 997 | return new Server(options, listener);
|
@@ -1133,7 +1139,7 @@ Server.prototype.setTicketKeys = function setTicketKeys(keys) {
|
1133 | 1139 | };
|
1134 | 1140 |
|
1135 | 1141 |
|
1136 |
| -Server.prototype.setOptions = util.deprecate(function(options) { |
| 1142 | +Server.prototype.setOptions = deprecate(function(options) { |
1137 | 1143 | this.requestCert = options.requestCert === true;
|
1138 | 1144 | this.rejectUnauthorized = options.rejectUnauthorized !== false;
|
1139 | 1145 |
|
|
0 commit comments