Skip to content

Commit

Permalink
fixup! Add TLS support w/ OpenSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Jul 30, 2023
1 parent 36334ac commit bab8f64
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,22 @@ std::ostream& operator<<(std::ostream& strm, const Server& serv)
<<" auth="<<conn->cred->method
<<(conn->iface->isTLS ? " TLS" : "")
<<"\n";
if(detail>2)
strm<<*conn->cred;

if(detail<=2)
continue;

Indented I(strm);

strm<<indent{}<<"Cred: "<<*conn->cred<<"\n";
#ifdef PVXS_ENABLE_OPENSSL
if(conn->iface->isTLS && conn->connection()) {
auto ctx = bufferevent_openssl_get_ssl(conn->connection());
assert(ctx);
auto cert = SSL_get0_peer_certificate(ctx);
strm<<indent{}<<"Cert: "<<ossl::ShowX509{cert}<<"\n";
}
#endif

for(auto& pair : conn->chanBySID) {
auto& chan = pair.second;
strm<<indent{}<<chan->name<<" TX="<<chan->statTx<<" RX="<<chan->statRx<<' ';
Expand Down

0 comments on commit bab8f64

Please sign in to comment.