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

Method setup_ssl

lib_acl_cpp/samples/ssl/server/main.cpp:80–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 }
79
80 bool setup_ssl(void) {
81 bool non_block = false;
82 acl::sslbase_io* ssl = ssl_conf_.create(non_block);
83
84 // ����˽�ж����� ssl_sni_checker::check() �м��
85 ssl->set_ctx(ssl);
86
87 // ����ʹ�� SSL ��ʽ����������Ҫ�� SSL IO ������ע��������
88 // �����������У����� ssl io �滻 stream ��Ĭ�ϵĵײ� IO ����
89 if (conn_->setup_hook(ssl) == ssl) {
90 printf("setup ssl IO hook error, errno=%d, %s\r\n",
91 acl::last_error(), acl::last_serror());
92 ssl->destroy();
93 return false;
94 }
95
96 printf("ssl handshake ok, sslbase_io=%p, has sni=%s\r\n",
97 ssl, ssl->has_sni() ? "yes" : "no");
98 return true;
99 }
100
101 void do_echo(void) {
102 char buf[4096];

Callers

nothing calls this directly

Calls 6

last_errorFunction · 0.85
last_serrorFunction · 0.50
createMethod · 0.45
set_ctxMethod · 0.45
setup_hookMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected