MCPcopy Create free account
hub / github.com/acl-dev/acl / setup_ssl

Method setup_ssl

lib_acl_cpp/samples/ssl/aio_client/main.cpp:221–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219 int dlen_;
220
221 bool setup_ssl(acl::sslbase_conf& ssl_conf)
222 {
223 acl::sslbase_io* ssl = ssl_conf.create(true);
224
225 // �� SSL IO ����ע�����첽����
226 if (client_->setup_hook(ssl) == ssl) {
227 std::cout << "open ssl error!" << std::endl;
228 ssl->destroy();
229 return false;
230 }
231
232 // ��ʼ SSL ���ֹ���
233 if (!ssl->handshake()) {
234 client_->remove_hook();
235 ssl->destroy();
236 return false;
237 }
238
239 if (ssl->handshake_ok()) {
240 printf("%s: ssl handshake ok\r\n", __FUNCTION__);
241 client_->disable_read();
242 return begin_run();
243 } else {
244 // ��ʼ�첽 SSL ���ֹ��̣�����ɶ�����ʱ������
245 // read_wakeup
246 client_->read_wait(10);
247 }
248 return true;
249 }
250
251 bool begin_run(void)
252 {

Callers

nothing calls this directly

Calls 7

disable_readMethod · 0.80
read_waitMethod · 0.80
createMethod · 0.45
setup_hookMethod · 0.45
destroyMethod · 0.45
handshakeMethod · 0.45
remove_hookMethod · 0.45

Tested by

no test coverage detected