Feature #6133

SSLSocketをshutdownできない

Added by Masashi Kikuchi about 2 years ago. Updated over 1 year ago.

[ruby-dev:45350]
Status:Assigned
Priority:Normal
Assignee:Hiroshi Nakamura
Category:ext
Target version:next minor

Description

http://www.openssl.org/docs/ssl/SSL_shutdown.html
に対応するメソッドがないので、送信の終わりを送れません。ただし微妙にshutdown(2)とインターフェースが違ってます。

History

#1 Updated by Yusuke Endoh about 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Martin Bosslet
  • Target version set to 2.0.0

Hello, emboss-san

This is a feature request for openssl.
OP wants a method to call SSL_shutdown to send the termination of a
transmission.

http://www.openssl.org/docs/ssl/SSL_shutdown.html

What do you think?

Note that there is a subtle difference between the API and shutdown(2).
As you may know.

Thanks,

Yusuke Endoh mame@tsg.ne.jp

#2 Updated by Martin Bosslet about 2 years ago

mame (Yusuke Endoh) wrote:

Hello, emboss-san

This is a feature request for openssl.
OP wants a method to call SSL_shutdown to send the termination of a
transmission.

http://www.openssl.org/docs/ssl/SSL_shutdown.html

What do you think?

Hello Yusuke,
thank you for the effort of translating this for me! So the problem
is that we don't explicitly expose shutdown in Ruby's OpenSSL API
and the OP would like to have that facility, did I understand
this correctly?

Note that there is a subtle difference between the API and shutdown(2).
As you may know.

Thanks for pointing this out - indeed, OpenSSL's shutdown behaves
differently than Socket's. But I think we can leave this complexity on
the side of the caller, shall they deal with it appropriately. I need
to investigate whether this would conflict with our internal handling
in sysclose, but if not, I tend to think nothing seems to prevent an
additional shutdown method.

-Martin

#3 Updated by Hiroshi Nakamura about 2 years ago

  • Assignee changed from Martin Bosslet to Hiroshi Nakamura

Oops. Sorry for confusing(?) you. It's me who was asked this question on Twitter. I didn't understand the question so I asked to file an issue, but I keep it opening because I still couldn't understand the point.

Martin, I'll ask OP for detail in Japanese and update you.

#4 Updated by Hiroshi Nakamura about 2 years ago

長々ほったらかしてすいませんでした。もう少し教えてください。

送信の終わりを送れません。

ここで言う「送信の終わりを送る」についてもう少し教えてください。

1) ドキュメント等にある(はずの)、通常のRubyのSSLSocketの使い方における送信の終わり方
2) kikさんが想定されている送信の終わり方

を、教えてください。

#5 Updated by Martin Bosslet about 2 years ago

nahi (Hiroshi Nakamura) wrote:

Martin, I'll ask OP for detail in Japanese and update you.

Thanks a lot!

#6 Updated by Masashi Kikuchi about 2 years ago

http://www.faqs.org/faqs/unix-faq/socket/
http://www.kt.rim.or.jp/~ksk/sock-faq/unix-socket-faq-ja-2.html#ss2.6

2.6 When should I use shutdown()?

のようなソケットプログラミングのイディオムをサーバがTLSで実装しているために、
クライアントを書いてる僕が困っているのです。

1) ドキュメント等にある(はずの)、通常のRubyのSSLSocketの使い方における送信の終わり方
たぶん、乱暴にcloseして送信と受信が同時に終了する方法しかないはずです

2) kikさんが想定されている送信の終わり方
FAQに書いてあるような丁寧な閉じ方です。

たぶん単純なTLSのechoサーバでも、丁寧に実装しようとするとクライアントにはshutdownがいると思います。

#7 Updated by Yusuke Endoh over 1 year ago

  • Target version changed from 2.0.0 to next minor

Also available in: Atom PDF