aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_ssl.c
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-04-24 02:10:42 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-04-27 23:07:42 +0900
commitaee4e753b50fda71c5ea5672ac845060f5e6aa09 (patch)
tree835c17d61d647bbbbef51e04277eaa424fa34d6e /ext/openssl/ossl_ssl.c
parent7e17fed37fb0da9e610156efe2b51ea182a21aa5 (diff)
downloadruby-aee4e753b50fda71c5ea5672ac845060f5e6aa09.tar.gz
ext/openssl: use SSL_is_server() to check if the SSL is server or not
The state returned by SSL_get_state() doesn't become SSL_ST_ACCEPT anymore in OpenSSL 1.1.0.
Diffstat (limited to 'ext/openssl/ossl_ssl.c')
-rw-r--r--ext/openssl/ossl_ssl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 4f215376c9..cfde8d7281 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -654,10 +654,9 @@ ssl_alpn_select_cb(SSL *ssl, const unsigned char **out, unsigned char *outlen, c
static void
ssl_info_cb(const SSL *ssl, int where, int val)
{
- int state = SSL_get_state(ssl);
+ int is_server = SSL_is_server((SSL *)ssl);
- if ((where & SSL_CB_HANDSHAKE_START) &&
- (state & SSL_ST_ACCEPT)) {
+ if (is_server && (where & SSL_CB_HANDSHAKE_START)) {
ssl_renegotiation_cb(ssl);
}
}