• Home
  • Raw
  • Download

Lines Matching full:options

78 } = require('internal/options');
87 const kConnectOptions = Symbol('connect-options');
460 'options.enableTrace', 'boolean', enableTrace);
584 const options = this._tlsOptions;
586 handle = options.pipe ?
593 const context = options.secureContext ||
594 options.credentials ||
595 tls.createSecureContext(options);
600 const res = tls_wrap.wrap(handle, context.context, !!options.isServer);
652 const options = this._tlsOptions;
654 this.server = options.server;
657 options.isServer ? 'server' : 'client',
663 const requestCert = !!options.requestCert || !options.isServer;
664 const rejectUnauthorized = !!options.rejectUnauthorized;
687 if (options.isServer) {
713 if (options.session)
714 ssl.setSession(options.session);
756 if (options.isServer &&
757 options.SNICallback &&
758 (options.SNICallback !== SNICallback ||
759 (options.server && options.server._contexts.length))) {
760 assert(typeof options.SNICallback === 'function');
761 this._SNICallback = options.SNICallback;
765 if (options.ALPNProtocols) {
767 ssl._secureContext.alpnBuffer = options.ALPNProtocols;
771 if (options.pskCallback && ssl.enablePskCallback) {
772 if (typeof options.pskCallback !== 'function') {
775 options.pskCallback);
778 ssl[kOnPskExchange] = options.isServer ?
781 this[kPskCallback] = options.pskCallback;
784 if (options.pskIdentityHint) {
785 if (typeof options.pskIdentityHint !== 'string') {
787 'options.pskIdentityHint',
789 options.pskIdentityHint
792 ssl.setPskIdentityHint(options.pskIdentityHint);
797 if (options.handshakeTimeout > 0)
798 this.setTimeout(options.handshakeTimeout, this._handleTimeout);
820 TLSSocket.prototype.renegotiate = function(options, callback) { argument
821 if (options === null || typeof options !== 'object')
822 throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
837 if (options.requestCert !== undefined)
838 requestCert = !!options.requestCert;
839 if (options.rejectUnauthorized !== undefined)
840 rejectUnauthorized = !!options.rejectUnauthorized;
1135 // Options:
1160 function Server(options, listener) { argument
1162 return new Server(options, listener);
1164 if (typeof options === 'function') {
1165 listener = options;
1166 options = {};
1167 } else if (options == null || typeof options === 'object') {
1168 options = options || {};
1170 throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
1174 this.requestCert = options.requestCert === true;
1175 this.rejectUnauthorized = options.rejectUnauthorized !== false;
1177 if (options.sessionTimeout)
1178 this.sessionTimeout = options.sessionTimeout;
1180 if (options.ticketKeys)
1181 this.ticketKeys = options.ticketKeys;
1183 if (options.ALPNProtocols)
1184 tls.convertALPNProtocols(options.ALPNProtocols, this);
1186 this.setSecureContext(options);
1188 this[kHandshakeTimeout] = options.handshakeTimeout || (120 * 1000);
1189 this[kSNICallback] = options.SNICallback;
1190 this[kPskCallback] = options.pskCallback;
1191 this[kPskIdentityHint] = options.pskIdentityHint;
1195 'options.handshakeTimeout', 'number', options.handshakeTimeout);
1200 'options.SNICallback', 'function', options.SNICallback);
1205 'options.pskCallback', 'function', options.pskCallback);
1209 'options.pskIdentityHint',
1211 options.pskIdentityHint
1216 net.Server.call(this, options, tlsConnectionListener);
1222 this[kEnableTrace] = options.enableTrace;
1228 exports.createServer = function createServer(options, listener) { argument
1229 return new Server(options, listener);
1233 Server.prototype.setSecureContext = function(options) { argument
1234 if (options === null || typeof options !== 'object')
1235 throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
1237 if (options.pfx)
1238 this.pfx = options.pfx;
1242 if (options.key)
1243 this.key = options.key;
1247 if (options.passphrase)
1248 this.passphrase = options.passphrase;
1252 if (options.cert)
1253 this.cert = options.cert;
1257 if (options.clientCertEngine)
1258 this.clientCertEngine = options.clientCertEngine;
1262 if (options.ca)
1263 this.ca = options.ca;
1267 if (options.minVersion)
1268 this.minVersion = options.minVersion;
1272 if (options.maxVersion)
1273 this.maxVersion = options.maxVersion;
1277 if (options.secureProtocol)
1278 this.secureProtocol = options.secureProtocol;
1282 if (options.crl)
1283 this.crl = options.crl;
1287 this.sigalgs = options.sigalgs;
1289 if (options.ciphers)
1290 this.ciphers = options.ciphers;
1294 this.ecdhCurve = options.ecdhCurve;
1296 if (options.dhparam)
1297 this.dhparam = options.dhparam;
1301 if (options.honorCipherOrder !== undefined)
1302 this.honorCipherOrder = !!options.honorCipherOrder;
1306 const secureOptions = options.secureOptions || 0;
1313 if (options.sessionIdContext) {
1314 this.sessionIdContext = options.sessionIdContext;
1322 if (options.sessionTimeout)
1323 this.sessionTimeout = options.sessionTimeout;
1325 if (options.ticketKeys)
1326 this.ticketKeys = options.ticketKeys;
1328 this.privateKeyIdentifier = options.privateKeyIdentifier;
1329 this.privateKeyEngine = options.privateKeyEngine;
1382 Server.prototype.setOptions = deprecate(function(options) { argument
1383 this.requestCert = options.requestCert === true;
1384 this.rejectUnauthorized = options.rejectUnauthorized !== false;
1386 if (options.pfx) this.pfx = options.pfx;
1387 if (options.key) this.key = options.key;
1388 if (options.passphrase) this.passphrase = options.passphrase;
1389 if (options.cert) this.cert = options.cert;
1390 if (options.clientCertEngine)
1391 this.clientCertEngine = options.clientCertEngine;
1392 if (options.ca) this.ca = options.ca;
1393 if (options.minVersion) this.minVersion = options.minVersion;
1394 if (options.maxVersion) this.maxVersion = options.maxVersion;
1395 if (options.secureProtocol) this.secureProtocol = options.secureProtocol;
1396 if (options.crl) this.crl = options.crl;
1397 if (options.ciphers) this.ciphers = options.ciphers;
1398 if (options.ecdhCurve !== undefined)
1399 this.ecdhCurve = options.ecdhCurve;
1400 if (options.dhparam) this.dhparam = options.dhparam;
1401 if (options.sessionTimeout) this.sessionTimeout = options.sessionTimeout;
1402 if (options.ticketKeys) this.ticketKeys = options.ticketKeys;
1403 const secureOptions = options.secureOptions || 0;
1404 if (options.honorCipherOrder !== undefined)
1405 this.honorCipherOrder = !!options.honorCipherOrder;
1409 if (options.ALPNProtocols)
1410 tls.convertALPNProtocols(options.ALPNProtocols, this);
1411 if (options.sessionIdContext) {
1412 this.sessionIdContext = options.sessionIdContext;
1419 if (options.pskCallback) this[kPskCallback] = options.pskCallback;
1420 if (options.pskIdentityHint) this[kPskIdentityHint] = options.pskIdentityHint;
1421 if (options.sigalgs) this.sigalgs = options.sigalgs;
1422 if (options.privateKeyIdentifier !== undefined)
1423 this.privateKeyIdentifier = options.privateKeyIdentifier;
1424 if (options.privateKeyEngine !== undefined)
1425 this.privateKeyEngine = options.privateKeyEngine;
1484 const options = args[0];
1487 // If args[0] was options, then normalize dealt with it.
1489 // find the options and merge them in, normalize's options has only
1490 // the host/port/path args that it knows about, not the tls options.
1491 // This means that options.host overrides a host arg.
1493 ObjectAssign(options, listArgs[1]);
1495 ObjectAssign(options, listArgs[2]);
1498 return cb ? [options, cb] : [options];
1502 const options = this[kConnectOptions];
1505 // specified in options.
1507 if (ekeyinfo.type === 'DH' && ekeyinfo.size < options.minDHSize) {
1520 const hostname = options.servername ||
1521 options.host ||
1522 (options.socket && options.socket._host) ||
1525 verifyError = options.checkServerIdentity(hostname, cert);
1534 // it to the tlssock connection options, explicitly check if it is false
1540 if (options.rejectUnauthorized !== false) {
1545 'authorizationError: %s', options.rejectUnauthorized,
1568 const options = this[kConnectOptions];
1573 error.path = options.path;
1574 error.host = options.host;
1575 error.port = options.port;
1576 error.localAddress = options.localAddress;
1581 // Arguments: [port,] [host,] [options,] [cb]
1584 let options = args[0];
1588 options = { variable
1593 ...options
1596 if (!options.keepAlive)
1597 options.singleUse = true;
1599 assert(typeof options.checkServerIdentity === 'function');
1600 assert(typeof options.minDHSize === 'number',
1601 'options.minDHSize is not a number: ' + options.minDHSize);
1602 assert(options.minDHSize > 0,
1603 'options.minDHSize is not a positive number: ' +
1604 options.minDHSize);
1606 const context = options.secureContext || tls.createSecureContext(options);
1608 const tlssock = new TLSSocket(options.socket, {
1609 allowHalfOpen: options.allowHalfOpen,
1610 pipe: !!options.path,
1614 rejectUnauthorized: options.rejectUnauthorized !== false,
1615 session: options.session,
1616 ALPNProtocols: options.ALPNProtocols,
1617 requestOCSP: options.requestOCSP,
1618 enableTrace: options.enableTrace,
1619 pskCallback: options.pskCallback,
1620 highWaterMark: options.highWaterMark,
1621 onread: options.onread,
1626 // it to the tlssock connection options, explicitly check if it is false
1629 options.rejectUnauthorized = options.rejectUnauthorized !== false;
1631 tlssock[kConnectOptions] = options;
1636 if (!options.socket) {
1639 if (options.timeout) {
1640 tlssock.setTimeout(options.timeout);
1643 tlssock.connect(options, tlssock._start);
1648 if (options.session)
1649 tlssock.setSession(options.session);
1651 if (options.servername) {
1652 if (!ipServernameWarned && net.isIP(options.servername)) {
1661 tlssock.setServername(options.servername);
1664 if (options.socket)