[ruby/openssl] ssl: use SSL_get_rbio() to check if SSL is started or not
Use SSL_get_rbio() instead of SSL_get_fd(). SSL_get_fd() internally calls SSL_get_rbio() and it's enough for our purpose. In OpenSSL 3.0, SSL_get_fd() leaves an entry in the OpenSSL error queue if BIO has not been set up yet, and we would have to clean it up. https://github.com/ruby/openssl/commit/e95ee24867
This commit is contained in:
parent
d5aa3fcae6
commit
fa24e7a57e
@ -1443,8 +1443,8 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
|
|||||||
static inline int
|
static inline int
|
||||||
ssl_started(SSL *ssl)
|
ssl_started(SSL *ssl)
|
||||||
{
|
{
|
||||||
/* the FD is set in ossl_ssl_setup(), called by #connect or #accept */
|
/* BIO is created through ossl_ssl_setup(), called by #connect or #accept */
|
||||||
return SSL_get_fd(ssl) >= 0;
|
return SSL_get_rbio(ssl) != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user