@@ -257,6 +257,7 @@ function callALPNCallback(protocolsBuffer) {
257
257
}
258
258
259
259
const selectedProtocol = socket [ kALPNCallback ] ( {
260
+ __proto__ : null ,
260
261
servername,
261
262
protocols,
262
263
} ) ;
@@ -436,7 +437,7 @@ function onPskClientCallback(hint, maxPskLen, maxIdentityLen) {
436
437
) ;
437
438
}
438
439
439
- return { psk : ret . psk , identity : ret . identity } ;
440
+ return { __proto__ : null , psk : ret . psk , identity : ret . identity } ;
440
441
}
441
442
442
443
function onkeylog ( line ) {
@@ -510,7 +511,7 @@ function initRead(tlsSocket, socket) {
510
511
*/
511
512
512
513
function TLSSocket ( socket , opts ) {
513
- const tlsOptions = { ...opts } ;
514
+ const tlsOptions = { __proto__ : null , ...opts } ;
514
515
let enableTrace = tlsOptions . enableTrace ;
515
516
516
517
if ( enableTrace == null ) {
@@ -563,6 +564,7 @@ function TLSSocket(socket, opts) {
563
564
this . encrypted = true ;
564
565
565
566
ReflectApply ( net . Socket , this , [ {
567
+ __proto__ : null ,
566
568
handle : this . _wrapHandle ( wrap ) ,
567
569
allowHalfOpen : socket ? socket . allowHalfOpen : tlsOptions . allowHalfOpen ,
568
570
pauseOnCreate : tlsOptions . pauseOnConnect ,
@@ -843,7 +845,7 @@ TLSSocket.prototype._init = function(socket, wrap) {
843
845
'by writing secret key material to file ' + tlsKeylog ) ;
844
846
}
845
847
this . on ( 'keylog' , ( line ) => {
846
- appendFile ( tlsKeylog , line , { mode : 0o600 } , ( err ) => {
848
+ appendFile ( tlsKeylog , line , { __proto__ : null , mode : 0o600 } , ( err ) => {
847
849
if ( err && warnOnTlsKeylogError ) {
848
850
warnOnTlsKeylogError = false ;
849
851
process . emitWarning ( 'Failed to write TLS keylog (this warning ' +
@@ -1078,7 +1080,7 @@ TLSSocket.prototype.setSession = function(session) {
1078
1080
TLSSocket . prototype . getPeerCertificate = function ( detailed ) {
1079
1081
if ( this . _handle ) {
1080
1082
return common . translatePeerCertificate (
1081
- this . _handle . getPeerCertificate ( detailed ) ) || { } ;
1083
+ this . _handle . getPeerCertificate ( detailed ) ) || { __proto__ : null } ;
1082
1084
}
1083
1085
1084
1086
return null ;
@@ -1088,7 +1090,7 @@ TLSSocket.prototype.getCertificate = function() {
1088
1090
if ( this . _handle ) {
1089
1091
// It's not a peer cert, but the formatting is identical.
1090
1092
return common . translatePeerCertificate (
1091
- this . _handle . getCertificate ( ) ) || { } ;
1093
+ this . _handle . getCertificate ( ) ) || { __proto__ : null } ;
1092
1094
}
1093
1095
1094
1096
return null ;
@@ -1179,6 +1181,7 @@ function onSocketClose(err) {
1179
1181
function tlsConnectionListener ( rawSocket ) {
1180
1182
debug ( 'net.Server.on(connection): new TLSSocket' ) ;
1181
1183
const socket = new TLSSocket ( rawSocket , {
1184
+ __proto__ : null ,
1182
1185
secureContext : this . _sharedCreds ,
1183
1186
isServer : true ,
1184
1187
server : this ,
@@ -1437,6 +1440,7 @@ Server.prototype.setSecureContext = function(options) {
1437
1440
this . privateKeyEngine = options . privateKeyEngine ;
1438
1441
1439
1442
this . _sharedCreds = tls . createSecureContext ( {
1443
+ __proto__ : null ,
1440
1444
pfx : this . pfx ,
1441
1445
key : this . key ,
1442
1446
passphrase : this . passphrase ,
@@ -1464,7 +1468,7 @@ Server.prototype.setSecureContext = function(options) {
1464
1468
1465
1469
Server . prototype . _getServerData = function ( ) {
1466
1470
return {
1467
- ticketKeys : this . getTicketKeys ( ) . toString ( 'hex' ) ,
1471
+ __proto__ : null , ticketKeys : this . getTicketKeys ( ) . toString ( 'hex' ) ,
1468
1472
} ;
1469
1473
} ;
1470
1474
@@ -1698,6 +1702,7 @@ exports.connect = function connect(...args) {
1698
1702
const allowUnauthorized = getAllowUnauthorized ( ) ;
1699
1703
1700
1704
options = {
1705
+ __proto__ : null ,
1701
1706
rejectUnauthorized : ! allowUnauthorized ,
1702
1707
ciphers : tls . DEFAULT_CIPHERS ,
1703
1708
checkServerIdentity : tls . checkServerIdentity ,
@@ -1718,6 +1723,7 @@ exports.connect = function connect(...args) {
1718
1723
const context = options . secureContext || tls . createSecureContext ( options ) ;
1719
1724
1720
1725
const tlssock = new TLSSocket ( options . socket , {
1726
+ __proto__ : null ,
1721
1727
allowHalfOpen : options . allowHalfOpen ,
1722
1728
pipe : ! ! options . path ,
1723
1729
secureContext : context ,
0 commit comments