@@ -257,6 +257,7 @@ function callALPNCallback(protocolsBuffer) {
257257 }
258258
259259 const selectedProtocol = socket [ kALPNCallback ] ( {
260+ __proto__ : null ,
260261 servername,
261262 protocols,
262263 } ) ;
@@ -436,7 +437,7 @@ function onPskClientCallback(hint, maxPskLen, maxIdentityLen) {
436437 ) ;
437438 }
438439
439- return { psk : ret . psk , identity : ret . identity } ;
440+ return { __proto__ : null , psk : ret . psk , identity : ret . identity } ;
440441}
441442
442443function onkeylog ( line ) {
@@ -510,7 +511,7 @@ function initRead(tlsSocket, socket) {
510511 */
511512
512513function TLSSocket ( socket , opts ) {
513- const tlsOptions = { ...opts } ;
514+ const tlsOptions = { __proto__ : null , ...opts } ;
514515 let enableTrace = tlsOptions . enableTrace ;
515516
516517 if ( enableTrace == null ) {
@@ -563,6 +564,7 @@ function TLSSocket(socket, opts) {
563564 this . encrypted = true ;
564565
565566 ReflectApply ( net . Socket , this , [ {
567+ __proto__ : null ,
566568 handle : this . _wrapHandle ( wrap ) ,
567569 allowHalfOpen : socket ? socket . allowHalfOpen : tlsOptions . allowHalfOpen ,
568570 pauseOnCreate : tlsOptions . pauseOnConnect ,
@@ -843,7 +845,7 @@ TLSSocket.prototype._init = function(socket, wrap) {
843845 'by writing secret key material to file ' + tlsKeylog ) ;
844846 }
845847 this . on ( 'keylog' , ( line ) => {
846- appendFile ( tlsKeylog , line , { mode : 0o600 } , ( err ) => {
848+ appendFile ( tlsKeylog , line , { __proto__ : null , mode : 0o600 } , ( err ) => {
847849 if ( err && warnOnTlsKeylogError ) {
848850 warnOnTlsKeylogError = false ;
849851 process . emitWarning ( 'Failed to write TLS keylog (this warning ' +
@@ -1078,7 +1080,7 @@ TLSSocket.prototype.setSession = function(session) {
10781080TLSSocket . prototype . getPeerCertificate = function ( detailed ) {
10791081 if ( this . _handle ) {
10801082 return common . translatePeerCertificate (
1081- this . _handle . getPeerCertificate ( detailed ) ) || { } ;
1083+ this . _handle . getPeerCertificate ( detailed ) ) || { __proto__ : null } ;
10821084 }
10831085
10841086 return null ;
@@ -1088,7 +1090,7 @@ TLSSocket.prototype.getCertificate = function() {
10881090 if ( this . _handle ) {
10891091 // It's not a peer cert, but the formatting is identical.
10901092 return common . translatePeerCertificate (
1091- this . _handle . getCertificate ( ) ) || { } ;
1093+ this . _handle . getCertificate ( ) ) || { __proto__ : null } ;
10921094 }
10931095
10941096 return null ;
@@ -1179,6 +1181,7 @@ function onSocketClose(err) {
11791181function tlsConnectionListener ( rawSocket ) {
11801182 debug ( 'net.Server.on(connection): new TLSSocket' ) ;
11811183 const socket = new TLSSocket ( rawSocket , {
1184+ __proto__ : null ,
11821185 secureContext : this . _sharedCreds ,
11831186 isServer : true ,
11841187 server : this ,
@@ -1437,6 +1440,7 @@ Server.prototype.setSecureContext = function(options) {
14371440 this . privateKeyEngine = options . privateKeyEngine ;
14381441
14391442 this . _sharedCreds = tls . createSecureContext ( {
1443+ __proto__ : null ,
14401444 pfx : this . pfx ,
14411445 key : this . key ,
14421446 passphrase : this . passphrase ,
@@ -1464,6 +1468,7 @@ Server.prototype.setSecureContext = function(options) {
14641468
14651469Server . prototype . _getServerData = function ( ) {
14661470 return {
1471+ __proto__ : null ,
14671472 ticketKeys : this . getTicketKeys ( ) . toString ( 'hex' ) ,
14681473 } ;
14691474} ;
@@ -1698,6 +1703,7 @@ exports.connect = function connect(...args) {
16981703 const allowUnauthorized = getAllowUnauthorized ( ) ;
16991704
17001705 options = {
1706+ __proto__ : null ,
17011707 rejectUnauthorized : ! allowUnauthorized ,
17021708 ciphers : tls . DEFAULT_CIPHERS ,
17031709 checkServerIdentity : tls . checkServerIdentity ,
@@ -1718,6 +1724,7 @@ exports.connect = function connect(...args) {
17181724 const context = options . secureContext || tls . createSecureContext ( options ) ;
17191725
17201726 const tlssock = new TLSSocket ( options . socket , {
1727+ __proto__ : null ,
17211728 allowHalfOpen : options . allowHalfOpen ,
17221729 pipe : ! ! options . path ,
17231730 secureContext : context ,
0 commit comments