Answer the question
In order to leave comments, you need to log in
How to make an encrypted channel between 2 applications?
There are 2 applications (node.js in my case) between which I want to establish an encrypted channel and exchange messages.
This is almost completely solved by TLS and client authentication. For example something like this: https://gist.github.com/pcan/e384fcad2a83e3ce20f9a... .
However, there is a problem:
This approach involves creating a server certificate that is bound to a domain name:
Specify server Common Name, like 'localhost' or 'server.localhost'. The client will verify this, so make sure you have a vaild DNS name for this.
connectTo('123.123.123.123:8000');
Answer the question
In order to leave comments, you need to log in
Yes, it is certainly possible.
The server certificate will validate your client application. At the same time, you can set your own function to check the certificate through options.checkServerIdentity()
https://nodejs.org/api/tls.html#tls_tls_checkserve...
Usually, in such cases, it is not the name and not the chain of trust that is checked, but simply the hash of the certificate server (fingerprint or fingerprint256 ) and absolutely any self-signed certificate is suitable, and it is much safer and more reliable than trusting root CAs. This technique in applications is usually called Certificate pinning.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question