aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGOTOU Yuuzou <gotoyuzo@notwork.org>2003-07-14 19:29:38 +0000
committerGOTOU Yuuzou <gotoyuzo@notwork.org>2003-07-14 19:29:38 +0000
commit0a86f1fe7a113965f27b5544448d2d4893bc1894 (patch)
tree74abf45817cf170d14833d4f0c8d52731ffd216e
parentff4eab599ddaede3879a5b02f7e5a7cb793a5d5f (diff)
downloadruby-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--ChangeLog12
-rw-r--r--extconf.rb1
-rw-r--r--lib/net/https.rb8
-rw-r--r--openssl_missing.h4
-rw-r--r--ossl.h8
5 files changed, 24 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 0948391..731b2b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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])
diff --git a/extconf.rb b/extconf.rb
index df43ab6..fd1b944 100644
--- a/extconf.rb
+++ b/extconf.rb
@@ -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
diff --git a/ossl.h b/ossl.h
index 7a807ee..6485046 100644
--- a/ossl.h
+++ b/ossl.h
@@ -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