| 63 | void SetDH(Base&); |
| 64 | |
| 65 | void 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 | |
| 87 | void SetDH(Base& base) |
no test coverage detected