Blynk Local Server DEPTH ZERO SELF SIGNED CERT

I am running blynk local server on Windows 7 machine without self signed cert. Next I am running a nodejs script on PI to connect to the server[local ip,port=8443].

The output of rpi while running script is:

Connecting to SSL :192.168.0.101:8443 
Error DEPTH_ZERO_SELF_SIGNED_CERT

Now I think it is not able to find self signed cert on Windows server. So i tried to create .crt and .pem file and also edited the server.properties file. But when I check log it says
C:\Users\Karan\Desktop\openssl-0.9.8k_X64 and key C:\Users\Karan\Desktop\openssl-0.9.8k_X64 paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.

So some one please tell me how to resolve the depth zero error, and if I am right about the self signed cert then tell me how to mention the path of server.crt and server.pem files in server.properties. [remember i am using Windows]

8443 is application port, not hardware. Where did you get it from?

Yeah so which port should i enter in the node js script? Or should i enter 8442 i.e. Hardware port.
If i enter 8442 it gives me error econnrefused

i get the same error on raspberry pi 2. I have installed a local server. If i start a programm on arduino with the local server on raspberrry all works well.
But if i start a programm directly on raspberry i get the errror:

Error DEPTH_ZERO_SELF_SIGNED_CERT

@Dmitriy So i removed the port no from script and its automatically assigning 8441 as the port. But still i am get this error DEPTH ZERO SELF SIGNED CERT. I even tried running the server on ubuntu and creating the certificates.
In logs it shows found server certificates but no client certificates using one way ssl.

Please tell me if i need to create certificate on rpi where i am running my node js script?

I’m having the same problem as well. Running RPi2 as local server and another RPiB+ as client.

@mrcoolkaran007 @shining01which guide did you use?

@vshymanskyy ideas?

For the server:

http://docs.blynk.cc/#blynk-server-how-to-run-local-blynk-server-launch-blynk-server-on-raspberry-pi

For the Raspberry Blynk Library:

http://www.instructables.com/id/Blynk-JavaScript-in-20-minutes-Raspberry-Pi-Edison/

For the client programm:

https://github.com/vshymanskyy/blynk-library-js/tree/master/examples

and

http://community.blynk.cc/t/how-to-connect-rpi-to-local-blynk-server-using-nodejs/2765

Is there an offical docu for JavaScript API for Blynk?

thats already my client code on raspberry. I would like to start the programm kodi with blynk by pressing a button in the ios app.

var Blynk = require('/usr/local/lib/node_modules/blynk-library');
var sys = require('sys')
var exec = require('child_process').exec;

var AUTH = 'XXXXXXXXXXX'; //uncomment ;)

var blynk = new Blynk.Blynk(AUTH,options= {addr:"192.168.10.7",port:8443});

var v9 = new blynk.VirtualPin(9);

v9.on('write', function(param) {
  console.log('V9:', param);
        function puts(error, stdout, stderr) { sys.puts(stdout) }
        exec("kodi", puts);
});

I used this guide for installing and running local server -


Also created self signed cert on the server i.e. ubuntu.

Running a nodejs script on rpi and it just doesn’t connect. Shows depth zero self signed certificate error.

Hi. the issue is explained here: https://github.com/vshymanskyy/blynk-library-js/issues/12
Thank you.

Following the solution does remove the DEPTH ZERO SELF SIGNED CERT error but now the new error becomes “undefined”.

Error:
OnOff mode
Connecting to SSL: 192.168.0.10 8441
Error undefined

server.properties:
server.ssl.cert=./server.crt
server.ssl.key=./server.pem
server.ssl.key.pass=some password
client.ssl.cert=
client.ssl.key=

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

i have the same config as @newrad . in blynk.log i get

07:51:05.274 WARN  - Found server certificates but no client certificate for '/home/pi' path. Using one way ssl.

i copied all certs ( i don’t know which specific) into the folder

/usr/local/lib/node_modules/blynk-library/certs/

But if i start my script i get “undefined”. In the script i use port 8441.

Hardware always uses one-way ssl… could you post more information, what exactly is printed?

@vhymanskyy . Here are the logs…

CLIENT:
OnOff mode
Connecting to SSL: 192.168.0.10 8441
Error undefined
Connecting to SSL: 192.168.0.10 8441
Error undefined
Connecting to SSL: 192.168.0.10 8441
Error undefined

SERVER: blynk.log
21:57:55.446 INFO - Using data dir ‘/home/pi/Blynk’
21:57:55.514 DEBUG - Starting reading user DB.
21:57:57.795 DEBUG - Reading user DB finished.
21:57:58.263 INFO - Initializing mail transport. Username : example@gmail.com.
SMTP host : smtp.gmail.com:587
21:57:59.650 DEBUG - hard.socket.idle.timeout = 15
21:57:59.651 INFO - Plain tcp/ip hardware server port 8442.
21:58:03.413 INFO - SSL hardware port 8441.
21:58:03.434 INFO - Enabling SSL for application.
21:58:03.436 WARN - Found server certificates but no client certificate for ‘/h
ome/pi’ path. Using one way ssl.
21:58:03.487 DEBUG - app.socket.idle.timeout = 600
21:58:03.488 INFO - Application server port 8443.
21:58:03.501 INFO - Administration server port 8777.
21:58:10.197 TRACE - Hardware channel disconnect.
21:58:14.744 TRACE - Hardware channel disconnect.
21:58:19.725 TRACE - Hardware channel disconnect.

@vshymanskyy . Here are my logs:

  1. i start the server

  2. then i start my client app

    root@raspberrypi:/home/pi/BlynkScripts# ./blynk-start-Kodi.js
    OnOff mode
    Connecting to SSL: 192.168.10.7 8441
    Error undefined
    Connecting to SSL: 192.168.10.7 8441
    Error undefined

After that i have the following lines in log:

    root@raspberrypi:/home/pi# cat ./logs/blynk.log
    16:08:15.677 INFO  - Using data dir '/home/pi/Blynk'
16:08:15.726 DEBUG - Starting reading user DB.
16:08:17.992 DEBUG - Reading user DB finished.
16:08:18.469 INFO  - Initializing mail transport. Username :xxx@xxx.com. SMTP host : mail.gmx.net:587
16:08:19.742 DEBUG - hard.socket.idle.timeout = 15
16:08:19.742 INFO  - Plain tcp/ip hardware server port 8442.
16:08:23.323 INFO  - SSL hardware port 8441.
16:08:23.345 INFO  - Enabling SSL for application.
16:08:23.347 WARN  - Found server certificates but no client certificate for '/home/pi' path. Using one way ssl.
16:08:23.400 DEBUG - app.socket.idle.timeout = 600
16:08:23.402 INFO  - Application server port 8443.
16:08:23.416 INFO  - Administration server port 8777.
16:09:27.188 TRACE - Hardware channel disconnect.
16:09:31.864 TRACE - Hardware channel disconnect.

@newrad @shining01 did you follow server deployment instructions? And changed below?

server.ssl.cert=./server_embedded.crt
server.ssl.key=./server_embedded.pem
server.ssl.key.pass=pupkin123

@Dmitriy

Yes and using below server properties. Tried using complete path as well but getting the same error.

I’ve tried using newly created jessie and wheezy images for raspberry pi thinking it may not be compatible to the latest debian version but still getting the same error on each version.

server.properties:
server.ssl.cert=./server.crt
server.ssl.key=./server.pem
server.ssl.key.pass=some password
client.ssl.cert=
client.ssl.key=

yes i followed this instructions.
My server.properties is in /home/pi. My certificats are in /home/pi/Cert
The server.jar file is in /home/pi.

my server.properties:

server.ssl.cert=./Cert/server.crt
server.ssl.key=./Cert/server.pem
server.ssl.key.pass=myPassword
client.ssl.cert=
client.ssl.key=

@shining01 @Dmitriy @vshymanskyy @mrcoolkaran007

I got it!

  1. When generating the certificate in the local server, make sure to use the hostname of the local server under Common Name (e.g. server FQDN or YOUR name). eg. raspberrypiserver
  2. Copy the server certificate(eg. server.crt) at client’s folder “/usr/local/lib/node_modules/blynk-library/certs”.
  3. In the client’s /etc/hosts file, insert the ip-address and hostname of the local server. eg. “192.168.0.10 raspberrypiserver”.
  4. In the client’s app, use the hostname instead of the IP-address. eg. addr:“raspberrypiserver”,port:8441