- F->ssl = SSL_new(ssl_client_ctx);
- SSL_set_fd((SSL *) F->ssl, F->fd);
- rb_setup_ssl_cb(F);
- rb_settimeout(F, sconn->timeout, rb_ssl_tryconn_timeout_cb, sconn);
- if((ssl_err = SSL_connect((SSL *) F->ssl)) <= 0)
- {
- switch (ssl_err = SSL_get_error((SSL *) F->ssl, ssl_err))
- {
- case SSL_ERROR_SYSCALL:
- if(rb_ignore_errno(errno))
- case SSL_ERROR_WANT_READ:
- case SSL_ERROR_WANT_WRITE:
- {
- F->ssl_errno = get_last_err();
- rb_setselect(F, RB_SELECT_READ | RB_SELECT_WRITE,
- rb_ssl_tryconn_cb, sconn);
- return;
- }
- default:
- F->ssl_errno = get_last_err();
- rb_ssl_connect_realcb(F, RB_ERROR_SSL, sconn);
- return;
- }
- }
- else
- {
- rb_ssl_connect_realcb(F, RB_OK, sconn);
- }
-}
-
-void
-rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest,
- struct sockaddr *clocal, CNCB * callback, void *data, int timeout)
-{
- struct ssl_connect *sconn;
- if(F == NULL)
- return;