@@ -394,7 +394,7 @@ function onPskClientCallback(hint, maxPskLen, maxIdentityLen) {
394394 ) ;
395395 }
396396
397- return { psk : ret . psk , identity : ret . identity } ;
397+ return { __proto__ : null , psk : ret . psk , identity : ret . identity } ;
398398}
399399
400400function onkeylog ( line ) {
@@ -468,7 +468,7 @@ function initRead(tlsSocket, socket) {
468468 */
469469
470470function TLSSocket ( socket , opts ) {
471- const tlsOptions = { ...opts } ;
471+ const tlsOptions = { __proto__ : null , ...opts } ;
472472 let enableTrace = tlsOptions . enableTrace ;
473473
474474 if ( enableTrace == null ) {
@@ -520,7 +520,7 @@ function TLSSocket(socket, opts) {
520520 this . encrypted = true ;
521521
522522 ReflectApply ( net . Socket , this , [ {
523- handle : this . _wrapHandle ( wrap ) ,
523+ __proto__ : null , handle : this . _wrapHandle ( wrap ) ,
524524 allowHalfOpen : socket ? socket . allowHalfOpen : tlsOptions . allowHalfOpen ,
525525 pauseOnCreate : tlsOptions . pauseOnConnect ,
526526 manualStart : true ,
@@ -790,7 +790,7 @@ TLSSocket.prototype._init = function(socket, wrap) {
790790 'by writing secret key material to file ' + tlsKeylog ) ;
791791 }
792792 this . on ( 'keylog' , ( line ) => {
793- appendFile ( tlsKeylog , line , { mode : 0o600 } , ( err ) => {
793+ appendFile ( tlsKeylog , line , { __proto__ : null , mode : 0o600 } , ( err ) => {
794794 if ( err && warnOnTlsKeylogError ) {
795795 warnOnTlsKeylogError = false ;
796796 process . emitWarning ( 'Failed to write TLS keylog (this warning ' +
@@ -1025,7 +1025,7 @@ TLSSocket.prototype.setSession = function(session) {
10251025TLSSocket . prototype . getPeerCertificate = function ( detailed ) {
10261026 if ( this . _handle ) {
10271027 return common . translatePeerCertificate (
1028- this . _handle . getPeerCertificate ( detailed ) ) || { } ;
1028+ this . _handle . getPeerCertificate ( detailed ) ) || { __proto__ : null } ;
10291029 }
10301030
10311031 return null ;
@@ -1035,7 +1035,7 @@ TLSSocket.prototype.getCertificate = function() {
10351035 if ( this . _handle ) {
10361036 // It's not a peer cert, but the formatting is identical.
10371037 return common . translatePeerCertificate (
1038- this . _handle . getCertificate ( ) ) || { } ;
1038+ this . _handle . getCertificate ( ) ) || { __proto__ : null } ;
10391039 }
10401040
10411041 return null ;
@@ -1126,7 +1126,7 @@ function onSocketClose(err) {
11261126function tlsConnectionListener ( rawSocket ) {
11271127 debug ( 'net.Server.on(connection): new TLSSocket' ) ;
11281128 const socket = new TLSSocket ( rawSocket , {
1129- secureContext : this . _sharedCreds ,
1129+ __proto__ : null , secureContext : this . _sharedCreds ,
11301130 isServer : true ,
11311131 server : this ,
11321132 requestCert : this . requestCert ,
@@ -1378,7 +1378,7 @@ Server.prototype.setSecureContext = function(options) {
13781378 this . privateKeyEngine = options . privateKeyEngine ;
13791379
13801380 this . _sharedCreds = tls . createSecureContext ( {
1381- pfx : this . pfx ,
1381+ __proto__ : null , pfx : this . pfx ,
13821382 key : this . key ,
13831383 passphrase : this . passphrase ,
13841384 cert : this . cert ,
@@ -1405,7 +1405,7 @@ Server.prototype.setSecureContext = function(options) {
14051405
14061406Server . prototype . _getServerData = function ( ) {
14071407 return {
1408- ticketKeys : this . getTicketKeys ( ) . toString ( 'hex' ) ,
1408+ __proto__ : null , ticketKeys : this . getTicketKeys ( ) . toString ( 'hex' ) ,
14091409 } ;
14101410} ;
14111411
@@ -1639,7 +1639,7 @@ exports.connect = function connect(...args) {
16391639 const allowUnauthorized = getAllowUnauthorized ( ) ;
16401640
16411641 options = {
1642- rejectUnauthorized : ! allowUnauthorized ,
1642+ __proto__ : null , rejectUnauthorized : ! allowUnauthorized ,
16431643 ciphers : tls . DEFAULT_CIPHERS ,
16441644 checkServerIdentity : tls . checkServerIdentity ,
16451645 minDHSize : 1024 ,
@@ -1659,7 +1659,7 @@ exports.connect = function connect(...args) {
16591659 const context = options . secureContext || tls . createSecureContext ( options ) ;
16601660
16611661 const tlssock = new TLSSocket ( options . socket , {
1662- allowHalfOpen : options . allowHalfOpen ,
1662+ __proto__ : null , allowHalfOpen : options . allowHalfOpen ,
16631663 pipe : ! ! options . path ,
16641664 secureContext : context ,
16651665 isServer : false ,
0 commit comments