| 99 | // |
| 100 | |
| 101 | void |
| 102 | SSLNetVConnection::_make_ssl_connection(SSL_CTX *ctx) |
| 103 | { |
| 104 | if (likely(this->ssl = SSL_new(ctx))) { |
| 105 | // Only set up the bio stuff for the server side |
| 106 | if (this->get_context() == NET_VCONNECTION_OUT) { |
| 107 | BIO *bio = BIO_new(const_cast<BIO_METHOD *>(BIO_s_fastopen())); |
| 108 | BIO_set_fd(bio, this->get_socket(), BIO_NOCLOSE); |
| 109 | |
| 110 | BIO_fastopen_set_dest_addr(bio, |
| 111 | this->options.f_tcp_fastopen ? this->get_remote_addr() : static_cast<const sockaddr *>(nullptr)); |
| 112 | |
| 113 | SSL_set_bio(ssl, bio, bio); |
| 114 | } else { |
| 115 | this->initialize_handshake_buffers(); |
| 116 | BIO *rbio = BIO_new(BIO_s_mem()); |
| 117 | BIO *wbio = BIO_new_socket(this->get_socket(), BIO_NOCLOSE); |
| 118 | BIO_set_mem_eof_return(wbio, -1); |
| 119 | SSL_set_bio(ssl, rbio, wbio); |
| 120 | |
| 121 | #if TS_HAS_TLS_EARLY_DATA |
| 122 | update_early_data_config(ssl, SSLConfigParams::server_max_early_data, SSLConfigParams::server_recv_max_early_data); |
| 123 | #endif |
| 124 | } |
| 125 | this->_bindSSLObject(); |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | void |
| 130 | SSLNetVConnection::_bindSSLObject() |
no test coverage detected