summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_ssl_session.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl_ssl_session.c')
-rw-r--r--ext/openssl/ossl_ssl_session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/openssl/ossl_ssl_session.c b/ext/openssl/ossl_ssl_session.c
index b347f2c1b22..82de3efbe33 100644
--- a/ext/openssl/ossl_ssl_session.c
+++ b/ext/openssl/ossl_ssl_session.c
@@ -174,7 +174,7 @@ static VALUE ossl_ssl_session_get_id(VALUE self)
p = SSL_SESSION_get_id(ctx, &i);
- return rb_str_new(p, i);
+ return rb_str_new((const char *) p, i);
}
#endif
@@ -200,7 +200,7 @@ static VALUE ossl_ssl_session_to_der(VALUE self)
else if (len >= sizeof(buf))
ossl_raise(eSSLSession, "i2d_SSL_SESSION too large");
- return rb_str_new(p, len);
+ return rb_str_new((const char *) p, len);
}
/*
@@ -289,6 +289,8 @@ void Init_ossl_ssl_session(void)
#ifdef HAVE_SSL_SESSION_GET_ID
rb_define_method(cSSLSession, "id", ossl_ssl_session_get_id, 0);
+#else
+ rb_undef_method(cSSLSession, "id");
#endif
rb_define_method(cSSLSession, "to_der", ossl_ssl_session_to_der, 0);
rb_define_method(cSSLSession, "to_pem", ossl_ssl_session_to_pem, 0);