@@ -43,7 +43,7 @@ enum CliCommand {
4343 listen_addr : SocketAddr ,
4444 /// The hostname:port or ip:port of the proxy server (port defaults to 443)
4545 target_addr : String ,
46- /// Type of attestation to present (dafaults to none )
46+ /// Type of attestation to present (dafaults to 'auto' for automatic detection )
4747 /// If other than None, a TLS key and certicate must also be given
4848 #[ arg( long, env = "CLIENT_ATTESTATION_TYPE" ) ]
4949 client_attestation_type : Option < String > ,
@@ -68,7 +68,7 @@ enum CliCommand {
6868 listen_addr : SocketAddr ,
6969 /// Socket address of the target service to forward traffic to
7070 target_addr : SocketAddr ,
71- /// Type of attestation to present (dafaults to none )
71+ /// Type of attestation to present (dafaults to 'auto' for automatic detection )
7272 /// If other than None, a TLS key and certicate must also be given
7373 #[ arg( long, env = "SERVER_ATTESTATION_TYPE" ) ]
7474 server_attestation_type : Option < String > ,
@@ -177,10 +177,6 @@ async fn main() -> anyhow::Result<()> {
177177 None
178178 } ;
179179
180- let client_attestation_type: AttestationType = serde_json:: from_value (
181- serde_json:: Value :: String ( client_attestation_type. unwrap_or ( "none" . to_string ( ) ) ) ,
182- ) ?;
183-
184180 let remote_tls_cert = match tls_ca_certificate {
185181 Some ( remote_cert_filename) => Some (
186182 load_certs_pem ( remote_cert_filename) ?
@@ -192,7 +188,8 @@ async fn main() -> anyhow::Result<()> {
192188 } ;
193189
194190 let client_attestation_generator =
195- AttestationGenerator :: new ( client_attestation_type, dev_dummy_dcap) ?;
191+ AttestationGenerator :: new_with_detection ( client_attestation_type, dev_dummy_dcap)
192+ . await ?;
196193
197194 let client = ProxyClient :: new (
198195 tls_cert_and_chain,
@@ -222,12 +219,9 @@ async fn main() -> anyhow::Result<()> {
222219 let tls_cert_and_chain =
223220 load_tls_cert_and_key ( tls_certificate_path, tls_private_key_path) ?;
224221
225- let server_attestation_type: AttestationType = serde_json:: from_value (
226- serde_json:: Value :: String ( server_attestation_type. unwrap_or ( "none" . to_string ( ) ) ) ,
227- ) ?;
228-
229222 let local_attestation_generator =
230- AttestationGenerator :: new ( server_attestation_type, dev_dummy_dcap) ?;
223+ AttestationGenerator :: new_with_detection ( server_attestation_type, dev_dummy_dcap)
224+ . await ?;
231225
232226 let server = ProxyServer :: new (
233227 tls_cert_and_chain,
0 commit comments