#include <openssl/rand.h>
#include <openssl/ocsp.h>
#include <openssl/bn.h>
+#include <openssl/async.h>
#ifndef OPENSSL_NO_SRP
# include <openssl/srp.h>
#endif
goto end;
}
- if (async)
+ if (async) {
SSL_CTX_set_mode(ctx, SSL_MODE_ASYNC);
+ ASYNC_init(1, 0, 0);
+ }
if (!config_ctx(cctx, ssl_args, ctx, 1, jpake_secret == NULL))
goto end;
BIO_free(fbio);
if (!foundit)
BIO_printf(bio_err,
- "didn't found starttls in server response,"
- " try anyway...\n");
+ "didn't find starttls in server response,"
+ " trying anyway...\n");
BIO_printf(sbio, "STARTTLS\r\n");
BIO_read(sbio, sbuf, BUFSIZZ);
}
BIO_free(fbio);
if (!foundit)
BIO_printf(bio_err,
- "didn't found STARTTLS in server response,"
- " try anyway...\n");
+ "didn't find STARTTLS in server response,"
+ " trying anyway...\n");
BIO_printf(sbio, ". STARTTLS\r\n");
BIO_read(sbio, sbuf, BUFSIZZ);
}
break;
case SSL_ERROR_WANT_ASYNC:
BIO_printf(bio_c_out, "write A BLOCK\n");
+ wait_for_async(con);
write_ssl = 1;
read_tty = 0;
break;
break;
case SSL_ERROR_WANT_ASYNC:
BIO_printf(bio_c_out, "read A BLOCK\n");
+ wait_for_async(con);
write_tty = 0;
read_ssl = 1;
if ((read_tty == 0) && (write_ssl == 0))
print_stuff(bio_c_out, con, 1);
SSL_free(con);
}
+ if (async) {
+ ASYNC_cleanup(1);
+ }
#if !defined(OPENSSL_NO_NEXTPROTONEG)
OPENSSL_free(next_proto.data);
#endif