LibTLS: Support opening connection as non-blocking

For OpenSSL to work properly, the socket must be non-blocking since
before the SSL connection is established.
This commit is contained in:
devgianlu 2025-02-19 14:20:26 +01:00 committed by Ali Mohammad Pur
commit 7d692711cb
Notes: github-actions[bot] 2025-02-22 17:41:28 +00:00
2 changed files with 29 additions and 8 deletions

View file

@ -33,6 +33,7 @@ struct Options {
}
OPTION_WITH_DEFAULTS(Optional<ByteString>, root_certificates_path, )
OPTION_WITH_DEFAULTS(bool, blocking, true)
};
class TLSv12 final : public Core::Socket {
@ -68,8 +69,6 @@ private:
static ErrorOr<NonnullOwnPtr<TLSv12>> connect_internal(NonnullOwnPtr<Core::TCPSocket>, ByteString const&, Options);
void wait_for_activity(bool);
SSL_CTX* m_ssl_ctx { nullptr };
SSL* m_ssl { nullptr };
BIO* m_bio { nullptr };