MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / SetUpBase

Function SetUpBase

extra/yassl/src/yassl.cpp:65–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63void SetDH(Base&);
64
65void SetUpBase(Base& base, ConnectionEnd end, SOCKET_T s)
66{
67 base.method_ = new SSL_METHOD(end, ProtocolVersion(3,1));
68 base.ctx_ = new SSL_CTX(base.method_);
69
70 if (base.ca_)
71 if (SSL_CTX_load_verify_locations(base.ctx_,
72 base.ca_, 0) != SSL_SUCCESS) throw(0);
73 if (base.cert_)
74 if (SSL_CTX_use_certificate_file(base.ctx_,
75 base.cert_, SSL_FILETYPE_PEM) != SSL_SUCCESS) throw(0);
76 if (base.key_)
77 if (SSL_CTX_use_PrivateKey_file(base.ctx_, base.key_,
78 SSL_FILETYPE_PEM) != SSL_SUCCESS) throw(0);
79
80 if (end == server_end) SetDH(base);
81
82 base.ssl_ = new SSL(base.ctx_);
83 base.ssl_->useSocket().set_fd(s);
84}
85
86
87void SetDH(Base& base)

Callers 2

ConnectMethod · 0.85
AcceptMethod · 0.85

Calls 6

ProtocolVersionClass · 0.85
SetDHFunction · 0.85
set_fdMethod · 0.80

Tested by

no test coverage detected