0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 23:43:09 +01:00
Commit Graph

24 Commits

Author SHA1 Message Date
Fedor Indutny
7c3643b767 tls: reintroduce socket.encrypted
Just a property that is always `true` for TLS sockets.

fix #6735
2013-12-21 01:03:05 +04:00
Fedor Indutny
f572b91c3e tls: fix handling of asterisk in SNI context
Wildcard server names should not match subdomains.

Quote from RFC2818:

   ...Names may contain the wildcard
   character * which is considered to match any single domain name
   component or component fragment. E.g., *.a.com matches foo.a.com but
   not bar.foo.a.com. f*.com matches foo.com but not bar.com.

fix #6610
2013-12-05 19:45:19 -08:00
Fedor Indutny
a6ddfe20d2 tls: more accurate wrapping of connecting socket
When socket, passed in `tls.connect()` `options` argument is not yet
connected to the server, `_handle` gets assigned to a `net.Socket`,
instead of `TLSSocket`.

When socket is connecting to the remote server (i.e. not yet connected,
but already past dns resolve phase), derive `_connecting` property from
it, because otherwise `afterConnect()` will throw an assertion.

fix #6443
2013-11-05 18:14:28 +04:00
Erik Dubbelboer
bb909ad642 tls: add ECDH ciphers support
Switch test fixtures to 1024 bit keys.
2013-10-30 08:34:47 +01:00
Fedor Indutny
ba7c9ce964 tls: do not default to 'localhost' servername 2013-10-31 01:57:20 +04:00
Fedor Indutny
5977cba985 tls: reuse hostname from underlying net.Socket
When `tls.connect()` is called with `socket` option, it should try to
reuse hostname previously passed to `net.connect()` and only after that
fall back to `'localhost'`.

fix #6409
2013-10-31 01:57:17 +04:00
Trevor Norris
25dce6d62d lint: fix a few semicolons 2013-09-24 14:35:30 -07:00
Fedor Indutny
42acbf809b tls: wrap tls inside tls using legacy API
Allow wrapping TLSSocket inside another TLSSocket, emulate it using
SecurePair in legacy APIs.

fix #6204
2013-09-24 20:46:59 +04:00
Fedor Indutny
af76b08666 tls: socket.renegotiate(options, callback)
This utility function allows renegotiaion of secure connection after
establishing it.

fix #2496
2013-09-05 18:10:31 +04:00
isaacs
1df77a7438 lib: Add missing copyright notices 2013-08-27 07:27:39 -07:00
Matthew Aynalem
c171c490f2 fixes #6031 spelling errors
explictly => explicitly
accesss => access
througput => throughput
epxression => expression
communiction => communication
becuase => because
repersent => represent
condonitions => conditions
decompresion => decompression
intentially => intentionally
eventes => events
listning => listening
resicved => received
becuase => because
fundimental => fundamental
colapse => collapse
privlages => privileges
sufficently => sufficiently
hapepns => happens
expliclitly => explicitly
thier => their
shold => should
2013-08-19 16:42:16 -07:00
Brian White
6d842897c5 lib: remove unused variables and functions 2013-08-15 17:19:17 -07:00
Fedor Indutny
c50750e1fd tls: handle errors on socket before releasing it
Fix sudden uncatchable ECONNRESETs, when using https server.
2013-08-14 21:10:32 +04:00
Fedor Indutny
166c405b33 tls: fix lazy initialization of clienthello parser
`server.SNICallback` was initialized with `SNICallback.bind(this)`, and
therefore check `this.SNICallback === SNICallback` was always false, and
`_tls_wrap.js` always thought that it was a custom callback instead of
default one. Which in turn was causing clienthello parser to be enabled
regardless of presence of SNI contexts.
2013-08-07 00:57:32 +04:00
Fedor Indutny
048e0e77e0 tls: asynchronous SNICallback
Make ClientHelloParser handle SNI extension, and extend `_tls_wrap.js`
to support loading SNI Context from both hello, and resumed session.

fix #5967
2013-08-06 16:13:01 +04:00
Fedor Indutny
ea7b817266 tls: fix handling of SNICallback server option
It shouldn't ignore it!

There're two possibile cases, which should be handled properly:

1. Having a default `SNICallback` which is using contexts, added with
  `server.addContext(...)` routine
2. Having a custom `SNICallback`.

In first case we may want to opt-out setting `.onsniselect` method (and
thus save some CPU time), if there're no contexts added. But, if custom
`SNICallback` is used, `.onsniselect` should always be set, because
server contexts don't affect it.
2013-08-04 14:11:28 +04:00
isaacs
22c68fdc1d src: Replace macros with util functions 2013-08-01 15:08:01 -07:00
Fedor Indutny
dda22a520b tls_wrap: parse tls session ticket extension
And, if present and non-empty, don't invoke `resumeSession` callback.

fix #5872
2013-08-01 16:06:45 +04:00
Fedor Indutny
d62c2d975a tls: share tls tickets key between cluster workers
fix #5871
2013-07-25 01:16:00 +04:00
Ben Noordhuis
0330bdf519 lib: macro-ify type checks
Increases the grep factor. Makes it easier to harmonize type checks
across the code base.
2013-07-24 21:49:35 +02:00
Fedor Indutny
07fbb43d78 tls: export TLSSocket 2013-07-03 16:15:31 +04:00
Fedor Indutny
212e9cd8c9 tls: session API returns 2013-06-17 14:00:26 +02:00
Fedor Indutny
dc50f27d52 tls: share socket._hadError with http_client 2013-06-16 09:30:15 +02:00
Fedor Indutny
af80e7bc6e tls: introduce TLSSocket based on tls_wrap binding
Split `tls.js` into `_tls_legacy.js`, containing legacy
`createSecurePair` API, and `_tls_wrap.js` containing new code based on
`tls_wrap` binding.

Remove tests that are no longer useful/valid.
2013-06-16 09:30:15 +02:00