Skip to content

Commit

Permalink
Set SNI for mbedTLS
Browse files Browse the repository at this point in the history
  • Loading branch information
melpon committed Nov 20, 2023
1 parent c6a6044 commit 7a01239
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/impl/tlstransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ TlsTransport::TlsTransport(variant<shared_ptr<TcpTransport>, shared_ptr<HttpProx
mbedtls::check(mbedtls_ssl_conf_own_cert(&mConf, crt.get(), pk.get()));
}

if (mIsClient && mHost) {
PLOG_VERBOSE << "Server Name Indication: " << *mHost;
mbedtls_ssl_set_hostname(&mSsl, mHost->c_str());
}

mbedtls::check(mbedtls_ssl_setup(&mSsl, &mConf));
mbedtls_ssl_set_bio(&mSsl, static_cast<void *>(this), WriteCallback, ReadCallback, NULL);

Expand Down

0 comments on commit 7a01239

Please sign in to comment.