p2p-node
p2p-node copied to clipboard
Enabled switching between tls and net package
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.
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 ... )
Host-object now has a .TLS boolean. The .socket attribute is always used to save the cleartextStream/TLSSocket (if useTLS == true).