Skip to content

Commit d5adcba

Browse files
authored
fix: rustls extraction of TlsInfo::peer_certificate() being truncated (#2195)
1 parent 7a5df21 commit d5adcba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/connect.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,7 @@ impl TlsInfoFactory for tokio_rustls::client::TlsStream<TokioIo<TokioIo<tokio::n
573573
.1
574574
.peer_certificates()
575575
.and_then(|certs| certs.first())
576-
.map(|c| c.first())
577-
.and_then(|c| c.map(|cc| vec![*cc]));
576+
.map(|c| c.to_vec());
578577
Some(crate::tls::TlsInfo { peer_certificate })
579578
}
580579
}
@@ -591,8 +590,7 @@ impl TlsInfoFactory
591590
.1
592591
.peer_certificates()
593592
.and_then(|certs| certs.first())
594-
.map(|c| c.first())
595-
.and_then(|c| c.map(|cc| vec![*cc]));
593+
.map(|c| c.to_vec());
596594
Some(crate::tls::TlsInfo { peer_certificate })
597595
}
598596
}

0 commit comments

Comments
 (0)