help icon indicating copy to clipboard operation
help copied to clipboard

Shutdown SSL but keeping socket alive

Open Neilpang opened this issue 6 years ago • 7 comments

I created a tls socket from a live socket instance.

Is there a way to gracefully shutdown tls, but keep the socket alive? I need to send more plain data over the raw socket.

Neilpang avatar Jun 06 '19 07:06 Neilpang

I suppose you could do that by means of tls.createSecurePair() and a net.Socket although I'm curious what your use case is. Downgrading is usually not a good thing.

I'm nominating this for moving to nodejs/help. This issue tracker is for bug reports, not questions/answers.

bnoordhuis avatar Jun 06 '19 07:06 bnoordhuis

@bnoordhuis Thanks for your fast reply.

but it seems that tls.createSecurePair is Deprecated. https://nodejs.org/api/tls.html#tls_tls_createsecurepair_context_isserver_requestcert_rejectunauthorized_options

I'm implementing protocols that need to switch between ssl and plain text on the same socket instance.

ssl ending doesn't require to close the raw socket.

Neilpang avatar Jun 06 '19 07:06 Neilpang

I'm sorry for the wrong repo. I didn't notice that.

Neilpang avatar Jun 06 '19 07:06 Neilpang

@Neilpang - is this still an issue?

gireeshpunathil avatar Nov 14 '20 12:11 gireeshpunathil

@gireeshpunathil Yes.

Neilpang avatar Nov 14 '20 15:11 Neilpang

I guess downgrading from secure to raw is not allowed as per standard. please refer https://datatracker.ietf.org/doc/html/rfc8446

preveen-stack avatar Jun 22 '23 12:06 preveen-stack

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] avatar May 15 '24 01:05 github-actions[bot]

It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] avatar Jun 14 '24 01:06 github-actions[bot]