Bug #12292 » 0002-ext-openssl-some-trivial-cleanups.patch
| ext/openssl/ossl_ssl.c | ||
|---|---|---|
|
val = rb_iv_get(self, "@alpn_protocols");
|
||
|
if (!NIL_P(val)) {
|
||
|
VALUE rprotos = ssl_encode_npn_protocols(val);
|
||
|
SSL_CTX_set_alpn_protos(ctx, (const unsigned char *)StringValueCStr(rprotos), RSTRING_LENINT(rprotos));
|
||
|
SSL_CTX_set_alpn_protos(ctx, (const unsigned char *)RSTRING_PTR(rprotos), RSTRING_LENINT(rprotos));
|
||
|
OSSL_Debug("SSL ALPN values added");
|
||
|
}
|
||
|
if (RTEST(rb_iv_get(self, "@alpn_select_cb"))) {
|
||
| ... | ... | |
|
ossl_raise(eSSLError, "SSL_CTX is not initialized.");
|
||
|
return Qnil;
|
||
|
}
|
||
|
if (!SSL_CTX_set_cipher_list(ctx, RSTRING_PTR(str))) {
|
||
|
if (!SSL_CTX_set_cipher_list(ctx, StringValueCStr(str))) {
|
||
|
ossl_raise(eSSLError, "SSL_CTX_set_cipher_list");
|
||
|
}
|
||
| ... | ... | |
|
static void
|
||
|
ossl_ssl_shutdown(SSL *ssl)
|
||
|
{
|
||
|
int i, rc;
|
||
|
int i;
|
||
|
if (ssl) {
|
||
|
/* 4 is from SSL_smart_shutdown() of mod_ssl.c (v2.2.19) */
|
||
| ... | ... | |
|
* Ignore the case SSL_shutdown returns -1. Empty handshake_func
|
||
|
* must not happen.
|
||
|
*/
|
||
|
if ((rc = SSL_shutdown(ssl)) != 0)
|
||
|
if (SSL_shutdown(ssl) != 0)
|
||
|
break;
|
||
|
}
|
||
|
SSL_clear(ssl);
|
||
|
ERR_clear_error();
|
||
|
}
|
||
|
}
|
||
| ... | ... | |
|
}
|
||
|
static VALUE
|
||
|
ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, VALUE opts)
|
||
|
ossl_start_ssl(VALUE self, int (*func)(SSL *), const char *funcname, VALUE opts)
|
||
|
{
|
||
|
SSL *ssl;
|
||
|
rb_io_t *fptr;
|
||
- « Previous
- 1
- 2
- 3
- Next »