Go to the documentation of this file.
19 #include <ruby/ruby.h>
83 "grpc_channel_credentials",
90 #ifdef RUBY_TYPED_FREE_IMMEDIATELY
91 RUBY_TYPED_FREE_IMMEDIATELY
148 VALUE pem_private_key = Qnil;
149 VALUE pem_cert_chain = Qnil;
153 const char* pem_root_certs_cstr = NULL;
165 if (pem_private_key == Qnil && pem_cert_chain == Qnil) {
168 if (pem_private_key == Qnil) {
171 "could not create a credentials because pem_private_key is NULL");
173 if (pem_cert_chain == Qnil) {
174 rb_raise(rb_eRuntimeError,
175 "could not create a credentials because pem_cert_chain is NULL");
177 key_cert_pair.
private_key = RSTRING_PTR(pem_private_key);
178 key_cert_pair.
cert_chain = RSTRING_PTR(pem_cert_chain);
183 rb_raise(rb_eRuntimeError,
184 "the call to grpc_ssl_credentials_create() failed, could not "
185 "create a credentials, see "
186 "https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md for "
210 rb_ary_push(mark,
self);
212 for (
int i = 0;
i < argc;
i++) {
213 rb_ary_push(mark, argv[
i]);
222 rb_raise(rb_eRuntimeError,
223 "Failed to compose channel and call credentials");
230 char** pem_root_certs_ptr) {
240 char* roots_ptr = StringValueCStr(roots);
241 size_t length = strlen(roots_ptr);
264 "set_default_roots_pem",
#define GRPC_RB_MEMSIZE_UNAVAILABLE
void grpc_ruby_shutdown()
static char * pem_root_certs
static void grpc_rb_channel_credentials_free(void *p)
GPRAPI void * gpr_malloc(size_t size)
GRPCAPI grpc_channel_credentials * grpc_ssl_credentials_create(const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, const verify_peer_options *verify_options, void *reserved)
VALUE grpc_rb_wrap_channel_credentials(grpc_channel_credentials *c, VALUE mark)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
grpc_channel_credentials * grpc_rb_get_wrapped_channel_credentials(VALUE v)
static VALUE grpc_rb_cChannelCredentials
@ GRPC_SSL_ROOTS_OVERRIDE_FAIL
grpc_call_credentials * grpc_rb_get_wrapped_call_credentials(VALUE v)
grpc_channel_credentials * wrapped
bool grpc_rb_is_channel_credentials(VALUE v)
grpc_ssl_roots_override_result
@ GRPC_SSL_ROOTS_OVERRIDE_OK
static rb_data_type_t grpc_rb_channel_credentials_data_type
GRPCAPI grpc_channel_credentials * grpc_composite_channel_credentials_create(grpc_channel_credentials *channel_creds, grpc_call_credentials *call_creds, void *reserved)
grpc_channel_wrapper * wrapper
void Init_grpc_channel_credentials()
static VALUE grpc_rb_set_default_roots_pem(VALUE self, VALUE roots)
static VALUE grpc_rb_channel_credentials_alloc(VALUE cls)
static ID id_pem_root_certs
GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials *creds)
#define ALLOC(class_name)
VALUE grpc_rb_cannot_init_copy(VALUE copy, VALUE self)
struct grpc_rb_channel_credentials grpc_rb_channel_credentials
GRPCAPI void grpc_set_ssl_roots_override_callback(grpc_ssl_roots_override_callback cb)
static grpc_ssl_roots_override_result get_ssl_roots_override(char **pem_root_certs_ptr)
static void grpc_rb_channel_credentials_mark(void *p)
static VALUE grpc_rb_channel_credentials_compose(int argc, VALUE *argv, VALUE self)
static VALUE grpc_rb_channel_credentials_init(int argc, VALUE *argv, VALUE self)
static ID id_pem_cert_chain
static ID id_pem_private_key
static void grpc_rb_channel_credentials_free_internal(void *p)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:59