mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
Use BIO for SSL connection.
This commit is contained in:
parent
22f124f871
commit
ba1107541e
1 changed files with 4 additions and 1 deletions
|
@ -1111,7 +1111,10 @@ template <typename U, typename T>
|
|||
inline bool read_and_close_socket_ssl(socket_t sock, SSL_CTX* ctx, U SSL_connect_or_accept, T callback)
|
||||
{
|
||||
auto ssl = SSL_new(ctx);
|
||||
SSL_set_fd(ssl, sock);
|
||||
|
||||
auto bio = BIO_new_socket(sock, BIO_NOCLOSE);
|
||||
SSL_set_bio(ssl, bio, bio);
|
||||
|
||||
SSL_connect_or_accept(ssl);
|
||||
|
||||
SSLSocketStream strm(ssl);
|
||||
|
|
Loading…
Reference in a new issue