ruby / openssl

Provides SSL, TLS and general purpose cryptography.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing `shutdown`, `close_write` and `close_read`.

ioquatix opened this issue · comments

These APIs can be quite important for certain types of servers.

I started trying to implement it and then realised how tricky it is to correctly support flags.

      def close_write
        stop
      end

      def shutdown(flags)
        if flags == ???
        stop
        to_io.shutdown(flags)
      end

Since the flags can be a symbol, a string, etc.

Also, I don't think SSLSocket can support close_read but I'll experiment.

TLS <= 1.2 doesn't support a half-closed state: https://datatracker.ietf.org/doc/html/rfc5246#section-7.2.1

It may be possible in TLS 1.3: https://datatracker.ietf.org/doc/html/rfc8446#section-6.1

I don't know how OpenSSL is handling it in TLS 1.3.