Changeset 503
- Timestamp:
- 08/15/07 09:56:48 (1 year ago)
- Files:
-
- version_0/ext/cmain.cpp (modified) (1 diff)
- version_0/ext/eventmachine.h (modified) (1 diff)
- version_0/ext/rubymain.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
version_0/ext/cmain.cpp
r483 r503 206 206 if (ed) 207 207 ed->StartTls(); 208 } 209 210 /****************** 211 evma_set_tls_parms 212 ******************/ 213 214 extern "C" void evma_set_tls_parms (const char *binding, const char *privatekey_filename, const char *certchain_filename) 215 { 216 if (!EventMachine) 217 throw std::runtime_error ("not initialized"); 218 EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding)); 219 if (ed) 220 ed->SetTlsParms (privatekey_filename, certchain_filename); 208 221 } 209 222 version_0/ext/eventmachine.h
r433 r503 44 44 const char *evma_create_unix_domain_server (const char *filename); 45 45 const char *evma_open_datagram_socket (const char *server, int port); 46 void evma_set_tls_parms (const char *binding, const char *privatekey_filename, const char *certchain_filenane); 46 47 void evma_start_tls (const char *binding); 47 48 int evma_get_peername (const char *binding, struct sockaddr*); version_0/ext/rubymain.cpp
r483 r503 136 136 { 137 137 evma_start_tls (StringValuePtr (signature)); 138 return Qnil; 139 } 140 141 /*************** 142 t_set_tls_parms 143 ***************/ 144 145 static VALUE t_set_tls_parms (VALUE self, VALUE signature, VALUE privkeyfile, VALUE certchainfile) 146 { 147 /* set_tls_parms takes a series of positional arguments for specifying such things 148 * as private keys and certificate chains. 149 * It's expected that the parameter list will grow as we add more supported features. 150 * ALL of these parameters are optional, and can be specified as empty or NULL strings. 151 */ 152 evma_set_tls_parms (StringValuePtr (signature), StringValuePtr (privkeyfile), StringValuePtr (certchainfile) ); 138 153 return Qnil; 139 154 } … … 453 468 rb_define_module_function (EmModule, "stop_tcp_server", (VALUE(*)(...))t_stop_server, 1); 454 469 rb_define_module_function (EmModule, "start_unix_server", (VALUE(*)(...))t_start_unix_server, 1); 470 rb_define_module_function (EmModule, "set_tls_parms", (VALUE(*)(...))t_set_tls_parms, 3); 455 471 rb_define_module_function (EmModule, "start_tls", (VALUE(*)(...))t_start_tls, 1); 456 472 rb_define_module_function (EmModule, "send_data", (VALUE(*)(...))t_send_data, 3);
