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

Method connect_server

lib_acl_cpp/samples/ssl/https_client/https_client.cpp:41–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41bool https_client::connect_server(acl::http_client& client)
42{
43 logger_debug(DEBUG, 1, "begin connect server");
44
45 if (client.open(server_addr_.c_str(), 60, 60, true) == false)
46 {
47 logger_error("failed to connect server %s", server_addr_.c_str());
48 return false;
49 }
50 else
51 logger_debug(DEBUG, 1, "connect server ok");
52
53 if (ssl_conf_)
54 {
55 logger("begin open ssl");
56
57 acl::sslbase_io* ssl = ssl_conf_->create(false);
58 ssl->set_sni_host(domain_);
59 if (client.get_stream().setup_hook(ssl) == ssl)
60 {
61 logger_error("open ssl client error");
62 ssl->destroy();
63 return false;
64 }
65 else
66 logger("open ssl ok");
67 }
68
69 return true;
70}
71
72int https_client::http_request(int count)
73{

Callers

nothing calls this directly

Calls 7

set_sni_hostMethod · 0.80
openMethod · 0.45
c_strMethod · 0.45
createMethod · 0.45
setup_hookMethod · 0.45
get_streamMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected