MbedTLS: Set socket send/receive functions after initialising session

This commit is contained in:
Aaron Jones 2016-09-15 11:40:00 +00:00
parent 978c8ae828
commit 46c61dd478
No known key found for this signature in database
GPG key ID: EC6F86EE9CD840B5

View file

@ -143,7 +143,6 @@ rb_ssl_init_fd(rb_fde_t *const F, rb_fd_tls_direction dir)
}
mbedtls_ssl_init(&mbed_ssl_ctx->ssl);
mbedtls_ssl_set_bio(&mbed_ssl_ctx->ssl, F, rb_sock_net_xmit, rb_sock_net_recv, NULL);
int ret;
@ -156,6 +155,8 @@ rb_ssl_init_fd(rb_fde_t *const F, rb_fd_tls_direction dir)
return;
}
mbedtls_ssl_set_bio(&mbed_ssl_ctx->ssl, F, rb_sock_net_xmit, rb_sock_net_recv, NULL);
rb_mbedtls_cfg_incref(rb_mbedtls_cfg);
mbed_ssl_ctx->cfg = rb_mbedtls_cfg;