MCPcopy Create free account
hub / github.com/apache/brpc / CreateSocketSSLContext

Function CreateSocketSSLContext

src/brpc/channel.cpp:309–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309static int CreateSocketSSLContext(const ChannelOptions& options,
310 std::shared_ptr<SocketSSLContext>* ssl_ctx) {
311 if (options.has_ssl_options()) {
312 SSL_CTX* raw_ctx = CreateClientSSLContext(options.ssl_options());
313 if (!raw_ctx) {
314 LOG(ERROR) << "Fail to CreateClientSSLContext";
315 return -1;
316 }
317 *ssl_ctx = std::make_shared<SocketSSLContext>();
318 (*ssl_ctx)->raw_ctx = raw_ctx;
319 (*ssl_ctx)->sni_name = options.ssl_options().sni_name;
320 (*ssl_ctx)->alpn_protocols = options.ssl_options().alpn_protocols;
321 } else {
322 (*ssl_ctx) = NULL;
323 }
324 return 0;
325}
326
327int Channel::Init(butil::EndPoint server_addr_and_port,
328 const ChannelOptions* options) {

Callers 2

InitSingleMethod · 0.85
InitMethod · 0.85

Calls 2

CreateClientSSLContextFunction · 0.50
has_ssl_optionsMethod · 0.45

Tested by

no test coverage detected