Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

TLS Handshake Failure #609

Closed
hicaro opened this issue Feb 16, 2017 · 4 comments
Closed

TLS Handshake Failure #609

hicaro opened this issue Feb 16, 2017 · 4 comments

Comments

@hicaro
Copy link
Contributor

hicaro commented Feb 16, 2017

After the TLS certificate used by the broker expired, mosca started to not treat the following error properly when a client attempts to connect:

{
"pid": 31532,
"hostname": "...",
"name": "mosca",
"level": 40,
"time": 1487192880702,
"msg": "47310591870208:error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1026:",
"type": "Error",
"stack": "Error: 47310591870208:error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1026:\n\n at Error (native)",
"client": "40ad36e2",
"v": 1
}

The broker does not crash, however it prints the message out at every new connection attempt.
Ater renewing the certificate, it stopped.

@hicaro hicaro changed the title Handshake Failure TLS TLS Handshake Failure Feb 16, 2017
@mcollina
Copy link
Collaborator

How should this error be handled?

@hicaro
Copy link
Contributor Author

hicaro commented Feb 18, 2017

When it happens, instead of printing it out to the console, a .emit("error", ...) could be used.

Then, inside the user's code it could be caught and treated the way he/she prefers:

// fired when a message is received
server.on('error', function(error) {
    // do whatever with the it 
});

By the way, thank you so much for the library!

@mcollina
Copy link
Collaborator

would you mind sending a PR?

@hicaro
Copy link
Contributor Author

hicaro commented Feb 18, 2017

Will do!

Thanks.

mcollina added a commit that referenced this issue May 2, 2017
Created clientError event (fixes #609)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants