1- extern crate rustls23 as rustls;
2-
31mod cli;
42mod config;
53
@@ -15,8 +13,11 @@ use std::{
1513use :: tracing:: { debug, info} ;
1614use cli:: NtsPoolKeOptions ;
1715use config:: { Config , NtsPoolKeConfig } ;
18- use rustls:: { pki_types:: CertificateDer , version:: TLS13 , ServerConnection } ;
19- use rustls23:: pki_types:: pem:: PemObject ;
16+ use rustls:: {
17+ pki_types:: { pem:: PemObject , CertificateDer } ,
18+ version:: TLS13 ,
19+ ServerConnection ,
20+ } ;
2021use rustls_platform_verifier:: Verifier ;
2122use tokio:: {
2223 io:: AsyncWriteExt ,
@@ -172,23 +173,23 @@ async fn run(options: NtsPoolKeOptions) -> Result<(), Box<dyn std::error::Error>
172173async fn run_nts_pool_ke ( nts_pool_ke_config : NtsPoolKeConfig ) -> std:: io:: Result < ( ) > {
173174 let certificate_authority_file =
174175 std:: fs:: File :: open ( & nts_pool_ke_config. certificate_authority_path ) . map_err ( |e| {
175- io_error ( & format ! (
176+ std :: io :: Error :: other ( format ! (
176177 "error reading certificate_authority_path at `{:?}`: {:?}" ,
177178 nts_pool_ke_config. certificate_authority_path, e
178179 ) )
179180 } ) ?;
180181
181182 let certificate_chain_file = std:: fs:: File :: open ( & nts_pool_ke_config. certificate_chain_path )
182183 . map_err ( |e| {
183- io_error ( & format ! (
184+ std :: io :: Error :: other ( format ! (
184185 "error reading certificate_chain_path at `{:?}`: {:?}" ,
185186 nts_pool_ke_config. certificate_chain_path, e
186187 ) )
187188 } ) ?;
188189
189190 let private_key_file =
190191 std:: fs:: File :: open ( & nts_pool_ke_config. private_key_path ) . map_err ( |e| {
191- io_error ( & format ! (
192+ std :: io :: Error :: other ( format ! (
192193 "error reading key_der_path at `{:?}`: {:?}" ,
193194 nts_pool_ke_config. private_key_path, e
194195 ) )
@@ -237,10 +238,6 @@ async fn run_nts_pool_ke(nts_pool_ke_config: NtsPoolKeConfig) -> std::io::Result
237238 . await
238239}
239240
240- fn io_error ( msg : & str ) -> std:: io:: Error {
241- std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , msg)
242- }
243-
244241async fn pool_key_exchange_server (
245242 address : impl ToSocketAddrs ,
246243 certificate_authority : Arc < [ rustls:: pki_types:: CertificateDer < ' static > ] > ,
0 commit comments