use BIO_new_mem_buf for read-only BIO.