@@ -40,8 +40,8 @@ var flags []cli.Flag = []cli.Flag{
4040 & cli.StringFlag {
4141 Name : "server-attestation-type" ,
4242 EnvVars : []string {"SERVER_ATTESTATION_TYPE" },
43- Value : string ( proxy . AttestationAzureTDX ) ,
44- Usage : "type of attestation to present (" + proxy .AvailableAttestationTypes + ")" ,
43+ Value : "" ,
44+ Usage : "type of attestation to present (" + proxy .AvailableAttestationTypes + "). If not set, automatically detected. " ,
4545 },
4646 & cli.StringFlag {
4747 Name : "tls-certificate-path" ,
@@ -132,10 +132,17 @@ func runServer(cCtx *cli.Context) error {
132132 return errors .New ("not all of --tls-certificate-path and --tls-private-key-path specified" )
133133 }
134134
135- serverAttestationType , err := proxy .ParseAttestationType (serverAttestationTypeFlag )
135+ // Auto-detect server attestation type if not specified
136+ serverAttestationType , err := proxy .ParseAttestationType (cCtx .String ("server-attestation-type" ))
136137 if err != nil {
137- log .With ("attestation-type" , cCtx .String ("server-attestation-type" )).Error ("invalid server-attestation-type passed, see --help" )
138- return err
138+ // If parsing fails and no type was specified, use auto-detection
139+ if cCtx .String ("server-attestation-type" ) == "" {
140+ serverAttestationType = proxy .DetectAttestationType ()
141+ log .With ("detected_attestation" , serverAttestationType ).Info ("Auto-detected server attestation type" )
142+ } else {
143+ log .With ("attestation-type" , cCtx .String ("server-attestation-type" )).Error ("invalid server-attestation-type passed, see --help" )
144+ return err
145+ }
139146 }
140147
141148 clientAttestationType , err := proxy .ParseAttestationType (cCtx .String ("client-attestation-type" ))
0 commit comments