Skip to content

Commit

Permalink
Merge pull request #1041 from melpon/mbedtls-sni
Browse files Browse the repository at this point in the history
Set SNI for MbedTLS
  • Loading branch information
paullouisageneau committed Nov 20, 2023
1 parent 07ace06 commit 54daa8f
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 54daa8f

Please sign in to comment.