aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/http/http_conn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/supplemental/http/http_conn.c')
-rw-r--r--src/supplemental/http/http_conn.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/supplemental/http/http_conn.c b/src/supplemental/http/http_conn.c
index 21087474..93068512 100644
--- a/src/supplemental/http/http_conn.c
+++ b/src/supplemental/http/http_conn.c
@@ -1482,6 +1482,20 @@ nni_http_conn_getopt(
return (rv);
}
+nng_err
+nni_http_conn_peer_cert(nni_http_conn *conn, nng_tls_cert **certp)
+{
+ int rv;
+ nni_mtx_lock(&conn->mtx);
+ if (conn->closed) {
+ rv = NNG_ECLOSED;
+ } else {
+ rv = nng_stream_peer_cert(conn->sock, certp);
+ }
+ nni_mtx_unlock(&conn->mtx);
+ return (rv);
+}
+
void
nni_http_conn_fini(nni_http_conn *conn)
{