From: Yugui Date: 2010-04-10T13:06:02+09:00 Subject: [ruby-core:29408] Re: [Bug #1907] ssl_timeout cannot be set in HTTPS request --000e0cd5cbf84b78910483d9b213 Content-Type: text/plain; charset=ISO-8859-1 > may I commit the following patch? OK. 2010/04/10 12:30 "Yusuke Endoh" : Issue #1907 has been updated by Yusuke Endoh. Assigned to set to Yuki Sonoda Hi, > Net::HTTPS defines SSL_ATTRIBUTES which, as I understand, are attributes that can be set on an HT... I'm not familiar with net/https and openssl, but > perhaps be aliased in SSLContext? I think it is reasonable because there are - SSLContext#timeout, - SSLContext#timeout=, and - SSLContext#ssl_timeout (as alias to SSLContext#timeout) but not SSLContext#ssl_timeout=. Adding `ssl_timeout=' may be considered as a new feature. But, the symptom OP reported is certainly a bug, and adding it is most appropriate fix the symptom, I think. Yugui, may I commit the following patch? diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index fe6e74f..e70a868 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -1577,6 +1577,7 @@ Init_ossl_ssl() for(i = 0; i < numberof(ossl_sslctx_attrs); i++) rb_attr(cSSLContext, rb_intern(ossl_sslctx_attrs[i]), 1, 1, Qfalse); rb_define_alias(cSSLContext, "ssl_timeout", "timeout"); + rb_define_alias(cSSLContext, "ssl_timeout=", "timeout="); rb_define_method(cSSLContext, "initialize", ossl_sslctx_initialize, -1); rb_define_method(cSSLContext, "ssl_version=", ossl_sslctx_set_ssl_version, 1); rb_define_method(cSSLContext, "ciphers", ossl_sslctx_get_ciphers, 0); -- Yusuke Endoh ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1907 ---------------------------------------- http://redmine.ruby-lang.org --000e0cd5cbf84b78910483d9b213 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

> may I commit the following patch?
OK.

2010/04/10 12:30 "Yusuke Endoh" <= redmine@ruby-lang.org>:
=
Issue #1907 has been updated by Yusuke Endoh.

Assigned to set to Yuki Sonoda

Hi,


> Net::HTTPS defines SSL_ATTRIBUTES which= , as I understand, are attributes that can be set on an HT...

I&#= 39;m not familiar with net/https and openssl, but



> perhaps be aliased in SSLContext?

I think it is reasonable because there are

=A0- SSLContext#timeout,
=A0- SSLContext#timeout=3D, and
=A0- SSLContext#ssl_timeout (as alias to SSLContext#timeout)

but not SSLContext#ssl_timeout=3D.

Adding `ssl_timeout=3D' may be considered as a new feature. =A0But, the=
symptom OP reported is certainly a bug, and adding it is most
appropriate fix the symptom, I think.


Yugui, may I commit the following patch?


diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index fe6e74f..e70a868 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -1577,6 +1577,7 @@ Init_ossl_ssl()
=A0 =A0 for(i =3D 0; i < numberof(ossl_sslctx_attrs); i++)
=A0 =A0 =A0 =A0 rb_attr(cSSLContext, rb_intern(ossl_sslctx_attrs[i]), 1, 1= , Qfalse);
=A0 =A0 rb_define_alias(cSSLContext, "ssl_timeout", "timeou= t");
+ =A0 =A0rb_define_alias(cSSLContext, "ssl_timeout=3D", "tim= eout=3D");
=A0 =A0 rb_define_method(cSSLContext, "initialize", =A0ossl_sslc= tx_initialize, -1);
=A0 =A0 rb_define_method(cSSLContext, "ssl_version=3D", ossl_ssl= ctx_set_ssl_version, 1);
=A0 =A0 rb_define_method(cSSLContext, "ciphers", =A0 =A0 ossl_ss= lctx_get_ciphers, 0);

--
Yusuke Endoh <mame@tsg.ne.jp> ----------------------------------------

http://redmine.ruby-lang.org/issues/show/1907

----------------------------------------

http://= redmine.ruby-lang.org

--000e0cd5cbf84b78910483d9b213--