mirror of https://github.com/getdnsapi/getdns.git
Only equip with peer cert when transport is TLS
This commit is contained in:
parent
a2efd8f6c1
commit
5f6e47d091
10
src/stub.c
10
src/stub.c
|
@ -1673,13 +1673,15 @@ upstream_write_cb(void *userarg)
|
|||
return;
|
||||
|
||||
default:
|
||||
cert = SSL_get_peer_certificate(netreq->upstream->tls_obj);
|
||||
assert(netreq->debug_tls_peer_cert.data == NULL);
|
||||
if (netreq->upstream->tls_obj &&
|
||||
(cert = SSL_get_peer_certificate(netreq->upstream->tls_obj))) {
|
||||
assert(netreq->debug_tls_peer_cert.data == NULL);
|
||||
|
||||
netreq->debug_tls_peer_cert.size = i2d_X509(
|
||||
cert, &netreq->debug_tls_peer_cert.data);
|
||||
}
|
||||
/* Need this because auth status is reset on connection close */
|
||||
netreq->debug_tls_auth_status = netreq->upstream->tls_auth_state;
|
||||
netreq->debug_tls_peer_cert.size = i2d_X509(
|
||||
cert, &netreq->debug_tls_peer_cert.data);
|
||||
upstream->queries_sent++;
|
||||
netreq->query_id = (uint16_t) q;
|
||||
/* Unqueue the netreq from the write_queue */
|
||||
|
|
Loading…
Reference in New Issue