p2p-node icon indicating copy to clipboard operation
p2p-node copied to clipboard

Enabled switching between tls and net package

Open GammaSQ opened this issue 10 years ago • 2 comments

A simple enhancement to allow the connection to be encrypted. Tests are passing. Weather tls or net is used can be set with a boolean in the settings.js and test-settings.js file. (I felt like having settings for the tests split from general settings. Both settings still have to carry the same useTLS-setting!) There is not yet an automated test to run all tests once with tls and once with net enabled. To implement a switch dependent on cryptocoinjs/coininfo, it can be required within the settings.js.

GammaSQ avatar Jan 27 '15 17:01 GammaSQ

I just found out that node version 11.3 introduced a TLSSocket-class. This means that my cleartextStream-check will fail! So please run tests with node.js < 0.11.3 ! So far I don't know when I will upgrade the code. (This has some uncomfortable implication for the Host-object ... needs some thinking ... )

GammaSQ avatar Feb 11 '15 21:02 GammaSQ

Host-object now has a .TLS boolean. The .socket attribute is always used to save the cleartextStream/TLSSocket (if useTLS == true).

GammaSQ avatar Feb 12 '15 23:02 GammaSQ