From: Yusuke Endoh Date: 2010-04-10T12:29:52+09:00 Subject: [ruby-core:29407] [Bug #1907] ssl_timeout cannot be set in HTTPS request 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 HTTP object and includes `ssl_timeout` > > However when applying these attributes on the SSLContext, the following exception is raised: 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