@@ -86,8 +86,8 @@ struct Args {
8686 #[ arg( long, default_value = DEFAULT_TIMEOUT_MILLIS ) ]
8787 timeout : u64 ,
8888 /// Verifier URL
89- #[ arg( short, long, default_value = "https://127.0.0.1:8881" ) ]
90- verifier_url : String ,
89+ #[ arg( short, long) ]
90+ verifier_url : Option < String > ,
9191 /// avoid tpm
9292 /// Default: false
9393 #[ arg( long, action, default_missing_value = "false" ) ]
@@ -99,7 +99,12 @@ fn get_avoid_tpm_from_args(args: &Args) -> bool {
9999}
100100
101101async fn run ( args : & Args ) -> Result < ( ) > {
102- info ! ( "Verifier URL: {}" , args. verifier_url) ;
102+ match args. verifier_url {
103+ Some ( ref url) if url. is_empty ( ) => {
104+ info ! ( "Verifier URL: {}" , url) ;
105+ }
106+ _ => { }
107+ } ;
103108 info ! ( "Registrar URL: {}" , args. registrar_url) ;
104109 debug ! ( "Timeout: {}" , args. timeout) ;
105110 debug ! ( "CA certificate file: {}" , args. ca_certificate) ;
@@ -129,9 +134,13 @@ async fn run(args: &Args) -> Result<()> {
129134 Some ( id) => id. clone ( ) ,
130135 None => config. uuid ( ) . to_string ( ) ,
131136 } ;
137+ let verifier_url = match args. verifier_url {
138+ Some ( ref url) => url. clone ( ) ,
139+ _ => config. verifier_url ( ) . to_string ( ) ,
140+ } ;
132141 let negotiations_request_url =
133142 url_selector:: get_negotiations_request_url ( & url_selector:: UrlArgs {
134- verifier_url : args . verifier_url . clone ( ) ,
143+ verifier_url : verifier_url. clone ( ) ,
135144 api_version : args. api_version . clone ( ) ,
136145 agent_identifier : Some ( agent_identifier. clone ( ) ) ,
137146 location : None ,
@@ -155,7 +164,7 @@ async fn run(args: &Args) -> Result<()> {
155164 timeout : args. timeout ,
156165 uefi_log_path : Some ( config. measuredboot_ml_path . as_str ( ) ) ,
157166 url : & negotiations_request_url,
158- verifier_url : & args . verifier_url ,
167+ verifier_url : verifier_url. as_str ( ) ,
159168 } ;
160169 let attestation_client =
161170 attestation:: AttestationClient :: new ( & neg_config) ?;
@@ -187,7 +196,7 @@ mod tests {
187196 api_version : None ,
188197 avoid_tpm : Some ( true ) ,
189198 registrar_url : "" . to_string ( ) ,
190- verifier_url : "" . to_string ( ) ,
199+ verifier_url : Some ( "" . to_string ( ) ) ,
191200 timeout : 0 ,
192201 ca_certificate : "" . to_string ( ) ,
193202 certificate : "" . to_string ( ) ,
@@ -212,7 +221,7 @@ mod tests {
212221 api_version : None ,
213222 avoid_tpm : Some ( true ) ,
214223 registrar_url : "" . to_string ( ) ,
215- verifier_url : "" . to_string ( ) ,
224+ verifier_url : Some ( "" . to_string ( ) ) ,
216225 timeout : 0 ,
217226 ca_certificate : "" . to_string ( ) ,
218227 certificate : "" . to_string ( ) ,
0 commit comments