OCSP_RESPONSE *process_responder(OCSP_REQUEST *req,
                                 const char *host, const char *path,
                                 const char *port, int use_ssl,
                                 STACK_OF(CONF_VALUE) *headers,
                                 int req_timeout)
{
    BIO *cbio = NULL;
    SSL_CTX *ctx = NULL;
    OCSP_RESPONSE *resp = NULL;
    cbio = BIO_new_connect(host);
    if (cbio == NULL) {
        BIO_printf(bio_err, "Error creating connect BIO\n");
        goto end;
    }
    if (port != NULL)
        BIO_set_conn_port(cbio, port);
    if (use_ssl == 1) {
        BIO *sbio;
        ctx = SSL_CTX_new(TLS_client_method());
        if (ctx == NULL) {
            BIO_printf(bio_err, "Error creating SSL context.\n");
            goto end;
        }
        SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
        sbio = BIO_new_ssl(ctx, 1);
        cbio = BIO_push(sbio, cbio);
    }
    resp = query_responder(cbio, host, path, headers, req, req_timeout);
    if (resp == NULL)
        BIO_printf(bio_err, "Error querying OCSP responder\n");
 end:
    BIO_free_all(cbio);
    SSL_CTX_free(ctx);
    return resp;
}
['OCSP_RESPONSE *process_responder(OCSP_REQUEST *req,\n                                 const char *host, const char *path,\n                                 const char *port, int use_ssl,\n                                 STACK_OF(CONF_VALUE) *headers,\n                                 int req_timeout)\n{\n    BIO *cbio = NULL;\n    SSL_CTX *ctx = NULL;\n    OCSP_RESPONSE *resp = NULL;\n    cbio = BIO_new_connect(host);\n    if (cbio == NULL) {\n        BIO_printf(bio_err, "Error creating connect BIO\\n");\n        goto end;\n    }\n    if (port != NULL)\n        BIO_set_conn_port(cbio, port);\n    if (use_ssl == 1) {\n        BIO *sbio;\n        ctx = SSL_CTX_new(TLS_client_method());\n        if (ctx == NULL) {\n            BIO_printf(bio_err, "Error creating SSL context.\\n");\n            goto end;\n        }\n        SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);\n        sbio = BIO_new_ssl(ctx, 1);\n        cbio = BIO_push(sbio, cbio);\n    }\n    resp = query_responder(cbio, host, path, headers, req, req_timeout);\n    if (resp == NULL)\n        BIO_printf(bio_err, "Error querying OCSP responder\\n");\n end:\n    BIO_free_all(cbio);\n    SSL_CTX_free(ctx);\n    return resp;\n}', 'BIO *BIO_new_connect(const char *str)\n{\n    BIO *ret;\n    ret = BIO_new(BIO_s_connect());\n    if (ret == NULL)\n        return NULL;\n    if (BIO_set_conn_hostname(ret, str))\n        return ret;\n    BIO_free(ret);\n    return NULL;\n}', 'const BIO_METHOD *BIO_s_connect(void)\n{\n    return &methods_connectp;\n}', 'void SSL_CTX_free(SSL_CTX *a)\n{\n    int i;\n    if (a == NULL)\n        return;\n    CRYPTO_DOWN_REF(&a->references, &i, a->lock);\n    REF_PRINT_COUNT("SSL_CTX", a);\n    if (i > 0)\n        return;\n    REF_ASSERT_ISNT(i < 0);\n    X509_VERIFY_PARAM_free(a->param);\n    dane_ctx_final(&a->dane);\n    if (a->sessions != NULL)\n        SSL_CTX_flush_sessions(a, 0);\n    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data);\n    lh_SSL_SESSION_free(a->sessions);\n    X509_STORE_free(a->cert_store);\n#ifndef OPENSSL_NO_CT\n    CTLOG_STORE_free(a->ctlog_store);\n#endif\n    sk_SSL_CIPHER_free(a->cipher_list);\n    sk_SSL_CIPHER_free(a->cipher_list_by_id);\n    sk_SSL_CIPHER_free(a->tls13_ciphersuites);\n    ssl_cert_free(a->cert);\n    sk_X509_NAME_pop_free(a->ca_names, X509_NAME_free);\n    sk_X509_NAME_pop_free(a->client_ca_names, X509_NAME_free);\n    sk_X509_pop_free(a->extra_certs, X509_free);\n    a->comp_methods = NULL;\n#ifndef OPENSSL_NO_SRTP\n    sk_SRTP_PROTECTION_PROFILE_free(a->srtp_profiles);\n#endif\n#ifndef OPENSSL_NO_SRP\n    SSL_CTX_SRP_CTX_free(a);\n#endif\n#ifndef OPENSSL_NO_ENGINE\n    ENGINE_finish(a->client_cert_engine);\n#endif\n#ifndef OPENSSL_NO_EC\n    OPENSSL_free(a->ext.ecpointformats);\n    OPENSSL_free(a->ext.supportedgroups);\n#endif\n    OPENSSL_free(a->ext.alpn);\n    OPENSSL_secure_free(a->ext.secure);\n    CRYPTO_THREAD_lock_free(a->lock);\n    OPENSSL_free(a);\n}', 'static inline int CRYPTO_DOWN_REF(_Atomic int *val, int *ret, void *lock)\n{\n    *ret = atomic_fetch_sub_explicit(val, 1, memory_order_relaxed) - 1;\n    if (*ret == 0)\n        atomic_thread_fence(memory_order_acquire);\n    return 1;\n}']