| 8178 | } |
| 8179 | |
| 8180 | TSSslContext |
| 8181 | TSSslServerContextCreate(TSSslX509 cert, const char *certname, const char *rsp_file) |
| 8182 | { |
| 8183 | TSSslContext ret = nullptr; |
| 8184 | SSLConfigParams *config = SSLConfig::acquire(); |
| 8185 | if (config != nullptr) { |
| 8186 | ret = reinterpret_cast<TSSslContext>(SSLCreateServerContext(config, nullptr)); |
| 8187 | if (ret && SSLConfigParams::ssl_ocsp_enabled && cert && certname) { |
| 8188 | if (SSL_CTX_set_tlsext_status_cb(reinterpret_cast<SSL_CTX *>(ret), ssl_callback_ocsp_stapling)) { |
| 8189 | if (!ssl_stapling_init_cert(reinterpret_cast<SSL_CTX *>(ret), reinterpret_cast<X509 *>(cert), certname, rsp_file)) { |
| 8190 | Warning("failed to configure SSL_CTX for OCSP Stapling info for certificate at %s", (const char *)certname); |
| 8191 | } |
| 8192 | } |
| 8193 | } |
| 8194 | SSLConfig::release(config); |
| 8195 | } |
| 8196 | return ret; |
| 8197 | } |
| 8198 | |
| 8199 | void |
| 8200 | TSSslContextDestroy(TSSslContext ctx) |