Local Blynk Server - disable ssl?

I installed a local server using mostly defaults. It was installed on a linux server where i also installed the blynk client for testing. It is behind my work firewalls, so there is no way to generate a valid cert. I tried the self-signed ones.

I connected with my IOS device successfully, with a valid user, and started a new project. got the auth emailed to me just fine. When i put in my test node js script it never connected, it continued to have ssl issues. I tried all three of the ports, made sure it was open (no firewall on the box), but it never quite worked.

I started over from scratch, no certs this time. It still tries to connect ssl, even when i do not specifiy the ssl port.

any idea what im missing ?
Is there a way to disable the ssl options on the server?

below are some logs - files.

server start

root@uthd00soagp0052:/blynk# /usr/bin/java -jar /blynk/server-0.41.0-java8.jar -dataFolder /blynk -serverConfig /blynk/server.config -mailConfig /blynk/mail.config

Blynk Server 0.41.1-SNAPSHOT successfully started.
All server output is stored in folder ‘/blynk/logs’ file.
Generating own initial certificates…
Error during certificate generation.
Challenge failed… Giving up.

At this point, i have never had an issue connecting my IOS device. Works great every time.

New project > i use raspberry pi, even though its just a generic linux box, get an auth and place it here.

connect.js

var Blynk = require(‘/usr/local/lib/node_modules/blynk-library’);
var AUTH = ‘d61610eb992644849f23e56058e15598’;
var blynk = new Blynk.Blynk(AUTH, options= {addr:“162.3.63.254”, port:8080});

node connect.js

___  __          __

/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/

Give Blynk a Github star! => GitHub - vshymanskyy/blynk-library-js: Blynk library for JS. Works with Browsers, Node.js, Espruino.

OnOff mode
Connecting to: 162.3.63.254 8080
SSL authorization…
events.js:188
throw err;
^

Error: Unhandled “error” event. (ECONNRESET)
at Blynk.emit (events.js:186:19)
at Blynk.error (/usr/local/lib/node_modules/blynk-library/blynk.js:604:8)
at exports.SslClient. (/usr/local/lib/node_modules/blynk-library/blynk.js:567:48)
at emitOne (events.js:116:13)
at exports.SslClient.emit (events.js:211:7)
at TLSSocket. (/usr/local/lib/node_modules/blynk-library/blynk-node.js:223:16)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)

I know it might appear that this is the only error i’ve received, but its one of 100 different types throughout my whole day of trying to connect. Ive tried rotating through the ports after every change, i’ve regened my AUTH with every new cert. I’ve tried two different versions of the java8 server. I know im doing something right, because my ios device keeps connecting.

Is there any way i can disable the ssl option on the server … maybe in the blink-node.js file? maybe somewhere else i might be missing? even when i try the non ssl ports, it still tries to use it.

What does your sketch look like?

var Blynk = require(‘/usr/local/lib/node_modules/blynk-library’);
var AUTH = ‘5b2500875e174421a4a302f8636fee68’;
var blynk = new Blynk.Blynk(AUTH, options= {addr:“162.3.63.254”, port:8440});

var v100 = new blynk.VirtualPin(100);
v100.on(‘read’, function() {
process.exec(‘date’, function (err, stdout, stderr) {
v100.write(stdout);
blynk.notify(“Yaaay… button is pressed!”);
blynk.syncVirtual(1);
})
});

I dont believe its sketch related, but still hoping you could confirm that part.

Im guessing its something to do with the way blynk-node handles the connectivity to the server… OR… its like its expecting a cert (a valid one) and doesnt like my setup. possible missing the private.key file location?

This is going to sound noob-ish… but would using a non-board (in this case its a full linux server) as a client, is there any hardware detection that would block it from connecting?

Try changing your port to 8080 as that is the new default Hardware Port

root@uthd00soagp0052:/blynk/test.app# node connect.js

___  __          __

/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/

Give Blynk a Github star! => https://github.com/vshymanskyy/blynk-library-js

OnOff mode
Connecting to: 162.3.63.254 8080
SSL authorization…
events.js:188
throw err;
^

Error: Unhandled “error” event. (ECONNRESET)
at Blynk.emit (events.js:186:19)
at Blynk.error (/usr/local/lib/node_modules/blynk-library/blynk.js:604:8)
at exports.SslClient. (/usr/local/lib/node_modules/blynk-library/blynk.js:567:48)
at emitOne (events.js:116:13)
at exports.SslClient.emit (events.js:211:7)
at TLSSocket. (/usr/local/lib/node_modules/blynk-library/blynk-node.js:223:16)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)

./logs/blynk.log

22:05:39.128 TRACE- Blynk hardware plain protocol connection detected.
22:05:39.128 TRACE- Incoming id=769, command=UpdateProject, body='�}K~�x2�w{F-��6����вf�i����<n�/�+�0�,��’g�(k�$��
����jih9876�2�.�*�&���=5�#�� ���@?>3210�1�-�)�%���</�V
162.3.63.254

3t’
22:05:39.128 DEBUG- Hardware not logged. /162.3.63.254:53360. Closing.

Change to this…

var blynk = new Blynk.Blynk(AUTH, options = {
  connector : new Blynk.TcpClient( options = { addr: "162.3.63.254", port: 8080 } )
});

As per this example (which is using wrong port… it is old documentation :stuck_out_tongue: )…

2 Likes

That was it!!!

In all of the directions i was following, it mentioned to move away from the Tcpclient option. In 99% of cases im guesing its correct for people that have ssl working the way it should. I probably still need the tcp option…

Thanks again Gunner… (ps, thats two times in two days where you’lve helped me out) much appricidated.

1 Like

Man, I wasted a lot of time today with this…should have just googled :stuck_out_tongue:

Annoyingly, it was saying ‘connected’ when connecting, but not getting to ‘authorised’ so I assumed the port was correct and was furiously investigating other avenues for hours!