# Ssl session shutdown

**URL:** <https://www.ruby-forum.com/t/ssl-session-shutdown/184265>\
**Category:** Ruby\
**Created:** [February 27, 2010, 5:51pm UTC](https://www.ruby-forum.com/t/ssl-session-shutdown/184265 "2010-02-27T17:51:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_Martyanoff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/a698b9/32.png) [@Nicolas\_Martyanoff](https://www.ruby-forum.com/u/Nicolas_Martyanoff)\
**Post date:** [February 27, 2010, 5:51pm UTC](https://www.ruby-forum.com/t/ssl-session-shutdown/184265/1 "2010-02-27T17:51:03Z")

</div>

Hi,

I have a ruby program which may reload itself with Kernel#exec. Since  
exec  
doesn’t close file descriptors, I’m able to keep the socket I use. One  
of  
these sockets uses SSL, with the openssl module.

I need to shutdown the SSL session before running exec, then restart it.  
In C,  
this is done with:

```
SSL_set_read_ahead(ssl, 0);
SSL_shutdown(ssl);
SSL_shutdown(ssl); /* For bidirectional shutdown, man SSL_shutdown 

```

\*/

I looked at the openssl library code, and it seens that neither  
SSL\_shutdown  
nor SSL\_set\_read\_ahead are binded.

Is there another way to stop the SSL session in ruby ?

Thank you.

Regards,
