#TLSSocket
1 messages · Page 1 of 1 (latest)
<@&987246452180930620> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
You can use </chatgpt:1108714622413963314> to ask ChatGPT about your question while you wait for a human to respond.
const tlsServerOptions = {
key: fs.readFileSync('./certs/server.key'),
cert: fs.readFileSync('./certs/server.crt'),
rejectUnauthorized: false,
requestCert: false
};
tls.createServer(tlsServerOptions, (socket) => {
socket.targetTlsBuffer = Buffer.alloc(0);
socket.targetTls = tls.connect(tlsClientOptions, () => {
if (socket.targetTlsBuffer.length > 0) {
socket.targetTls.write(socket.targetTlsBuffer);
}
});
socket.targetTls.on('data', buffer => {
console.log(buffer.toString());
});
socket.on('data', buffer => {
console.log(buffer.toString());
});
}).listen(port);
Something similar to this but in java.
I couldn't find a way to get it working with key and crt in java.
I proceeded to use PKCS12, but server connects were not successful still
@granite gate
Java and JavaScript are two completely unrelated programming languages.
https://i.imgur.com/yYFdXet.png
Perhaps you'd find better support if you used the other tag for your thread instead of Java
or web etc
this is javascript not java
if you want to use java, consider looking at vert.x
Just wanted to indicate what I meant, cuz using cert and key seemed not possible in java.
That's why I said something similar to this in java
So can it be used to create tls servers?
so basically you want to make a TLS socket? you can have a look at this
is vert.x modular btw?
If yes, then it's no problem for me to switch.
yeah but also look at somerandom's link - that's pretty good if you don't want any deps