diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-25 16:40:26 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-25 16:40:26 +0000 |
commit | 2b15bd05d3ec35390b07e1305a118040a4c320b3 (patch) | |
tree | c5d2ce933fd4d983fd195c215abd867b9329f3c3 | |
parent | ec75bfe3646c00f20cab7c9c154318609b3cf41d (diff) | |
download | ruby-2b15bd05d3ec35390b07e1305a118040a4c320b3.tar.gz |
* ext/openssl/ossl_ssl.c (ossl_ssl_setup): need to pass the real
socket to SSL_get_fd on native win32 platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ext/openssl/ossl_ssl.c | 8 |
2 files changed, 13 insertions, 2 deletions
@@ -1,4 +1,9 @@ -Fri Jul 25 15:04:25 2003 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp> +Sat Jul 26 01:33:51 2003 NAKAMURA Usaku <usa@ruby-lang.org> + + * ext/openssl/ossl_ssl.c (ossl_ssl_setup): need to pass the real + socket to SSL_get_fd on native win32 platforms. + +Fri Jul 26 00:04:25 2003 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp> * ext/openssl/sample: Add samples. - cert2text.rb: Dump certificate file as text. diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index e4fb0bf78c..387b71c3b1 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -19,6 +19,12 @@ #define numberof(ary) (sizeof(ary)/sizeof(ary[0])) +#ifdef OPENSSL_SYS_WINDOWS +# define TO_SOCKET(s) _get_osfhandle(s) +#else +# define TO_SOCKET(s) s +#endif + VALUE mSSL; VALUE eSSLError; VALUE cSSLContext; @@ -392,7 +398,7 @@ ossl_ssl_setup(VALUE self) GetOpenFile(io, fptr); rb_io_check_readable(fptr); rb_io_check_writable(fptr); - SSL_set_fd(ssl, fileno(fptr->f)); + SSL_set_fd(ssl, TO_SOCKET(fileno(fptr->f))); } return Qtrue; |