File tree 2 files changed +6
-6
lines changed
tonic/src/transport/server
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ pub(crate) struct TlsAcceptor {
19
19
20
20
impl TlsAcceptor {
21
21
pub ( crate ) fn new (
22
- identity : Identity ,
23
- client_ca_root : Option < Certificate > ,
22
+ identity : & Identity ,
23
+ client_ca_root : Option < & Certificate > ,
24
24
client_auth_optional : bool ,
25
25
ignore_client_order : bool ,
26
26
) -> Result < Self , crate :: BoxError > {
@@ -30,7 +30,7 @@ impl TlsAcceptor {
30
30
None => builder. with_no_client_auth ( ) ,
31
31
Some ( cert) => {
32
32
let mut roots = RootCertStore :: empty ( ) ;
33
- roots. add_parsable_certificates ( convert_certificate_to_pki_types ( & cert) ?) ;
33
+ roots. add_parsable_certificates ( convert_certificate_to_pki_types ( cert) ?) ;
34
34
let verifier = if client_auth_optional {
35
35
WebPkiClientVerifier :: builder ( roots. into ( ) ) . allow_unauthenticated ( )
36
36
} else {
@@ -41,7 +41,7 @@ impl TlsAcceptor {
41
41
}
42
42
} ;
43
43
44
- let ( cert, key) = convert_identity_to_pki_types ( & identity) ?;
44
+ let ( cert, key) = convert_identity_to_pki_types ( identity) ?;
45
45
let mut config = builder. with_single_cert ( cert, key) ?;
46
46
config. ignore_client_order = ignore_client_order;
47
47
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ impl ServerTlsConfig {
66
66
67
67
pub ( crate ) fn tls_acceptor ( & self ) -> Result < TlsAcceptor , crate :: BoxError > {
68
68
TlsAcceptor :: new (
69
- self . identity . clone ( ) . unwrap ( ) ,
70
- self . client_ca_root . clone ( ) ,
69
+ self . identity . as_ref ( ) . unwrap ( ) ,
70
+ self . client_ca_root . as_ref ( ) ,
71
71
self . client_auth_optional ,
72
72
self . ignore_client_order ,
73
73
)
You can’t perform that action at this time.
0 commit comments