diff options
author | GOTOU Yuuzou <gotoyuzo@notwork.org> | 2003-07-14 19:29:38 +0000 |
---|---|---|
committer | GOTOU Yuuzou <gotoyuzo@notwork.org> | 2003-07-14 19:29:38 +0000 |
commit | 0a86f1fe7a113965f27b5544448d2d4893bc1894 (patch) | |
tree | 74abf45817cf170d14833d4f0c8d52731ffd216e | |
parent | ff4eab599ddaede3879a5b02f7e5a7cb793a5d5f (diff) | |
download | ruby-openssl-history-0a86f1fe7a113965f27b5544448d2d4893bc1894.tar.gz |
* openssl_missing.h: add MS_CALLBACK.
* extconf.rb: should check <openssl/e_os.h>.
* ossl.h: check HAVE_OPENSSL_E_OS_H.
* net/https.rb: follow ruby-1.8.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | extconf.rb | 1 | ||||
-rw-r--r-- | lib/net/https.rb | 8 | ||||
-rw-r--r-- | openssl_missing.h | 4 | ||||
-rw-r--r-- | ossl.h | 8 |
5 files changed, 24 insertions, 9 deletions
@@ -1,12 +1,18 @@ -Tue, 10 Dec 2002 02:32:54 -0900 -- GOTOU Yuuzou <gotoyuzo@notwork.org> +Tue, 15 Jul 2002 04:19:44 +0900 -- GOTOU Yuuzou <gotoyuzo@notwork.org> + * openssl_missing.h: add MS_CALLBACK. + * extconf.rb: should check <openssl/e_os.h>. + * ossl.h: check HAVE_OPENSSL_E_OS_H. + * net/https.rb: follow ruby-1.8. + +Tue, 10 Dec 2002 02:32:54 +0900 -- GOTOU Yuuzou <gotoyuzo@notwork.org> * ossl-0.1.3 released -Mon, 9 Dec 2002 22:26:15 -0900 -- GOTOU Yuuzou <gotoyuzo@notwork.org> +Mon, 9 Dec 2002 22:26:15 +0900 -- GOTOU Yuuzou <gotoyuzo@notwork.org> * x509name.c: let initialize() give a Array instead of a Hash. to_a is implemented and to_h is deprecated. * openssl.rb: X509::Name is refined. -Mon, 9 Dec 2002 20:21:32 -0900 -- GOTOU Yuuzou <gotoyuzo@notwork.org> +Mon, 9 Dec 2002 20:21:32 +0900 -- GOTOU Yuuzou <gotoyuzo@notwork.org> * ossl.c: use ruby_unsetenv() instead of unsetenv(). * ssl.c: the return value of SSL_read/SSL_write is int (not size_t). This fix is suggested by matz. ([ruby-list:36721]) @@ -28,6 +28,7 @@ if with_config("debug") or enable_config("debug") # '--enable-debug' or '--with- end if have_header("openssl/ssl.h") + have_header("openssl/e_os.h") if have_library(CRYPTOLIB, "OpenSSL_add_all_algorithms") and have_library(SSLLIB, "SSLv23_method") create_makefile("openssl") end diff --git a/lib/net/https.rb b/lib/net/https.rb index 727a12c..67b8561 100644 --- a/lib/net/https.rb +++ b/lib/net/https.rb @@ -96,7 +96,9 @@ require 'net/http' module Net class HTTP - protocol_param :socket_type, ::Net::NetPrivate::SSLSocket + def HTTP.socket_type + ::Net::NetPrivate::SSLSocket + end attr_accessor :use_ssl attr_writer :key, :cert, :key_file, :cert_file @@ -110,7 +112,7 @@ module Net @socket.writeline( sprintf('CONNECT %s:%s HTTP/%s', @address, @port, "1.0")) @socket.writeline '' - resp = HTTPResponse.read_new(@socket, nil) + resp = HTTPResponse.read_new(@socket) if resp.code != '200' raise resp.message end @@ -126,7 +128,7 @@ module Net @socket.verify_depth = @verify_depth @socket.timeout = @timeout @socket.ssl_connect - @peer_cert = socket.peer_cert + @peer_cert = @socket.peer_cert end end diff --git a/openssl_missing.h b/openssl_missing.h index 56f1667..cfc19a2 100644 --- a/openssl_missing.h +++ b/openssl_missing.h @@ -50,6 +50,10 @@ extern "C" { int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in); #endif /* NO_HMAC */ +#if !defined(MS_CALLBACK) +#define MS_CALLBACK +#endif + #ifdef __cplusplus } #endif @@ -15,7 +15,7 @@ extern "C" { #endif -#if defined(NT) +#if defined(NT) || defined(_WIN32) # define OpenFile WINAPI_OpenFile #endif #include <errno.h> @@ -25,8 +25,10 @@ extern "C" { #include <openssl/ssl.h> #include <openssl/hmac.h> #include <openssl/rand.h> -#include <openssl/e_os.h> -#if defined(NT) +#if HAVE_OPENSSL_E_OS_H +# include <openssl/e_os.h> +#endif +#if defined(NT) || defined(_WIN32) # undef OpenFile #endif |