@@ -450,15 +450,6 @@ static void validateCommonTlsContext(
450
450
throw new ResourceInvalidException (
451
451
"common-tls-context with validation_context_sds_secret_config is not supported" );
452
452
}
453
- if (commonTlsContext .hasValidationContextCertificateProvider ()) {
454
- throw new ResourceInvalidException (
455
- "common-tls-context with validation_context_certificate_provider is not supported" );
456
- }
457
- if (commonTlsContext .hasValidationContextCertificateProviderInstance ()) {
458
- throw new ResourceInvalidException (
459
- "common-tls-context with validation_context_certificate_provider_instance is not"
460
- + " supported" );
461
- }
462
453
String certInstanceName = getIdentityCertInstanceName (commonTlsContext );
463
454
if (certInstanceName == null ) {
464
455
if (server ) {
@@ -473,10 +464,6 @@ static void validateCommonTlsContext(
473
464
throw new ResourceInvalidException (
474
465
"tls_certificate_provider_instance is unset" );
475
466
}
476
- if (commonTlsContext .hasTlsCertificateCertificateProvider ()) {
477
- throw new ResourceInvalidException (
478
- "tls_certificate_provider_instance is unset" );
479
- }
480
467
} else if (certProviderInstances == null || !certProviderInstances .contains (certInstanceName )) {
481
468
throw new ResourceInvalidException (
482
469
"CertificateProvider instance name '" + certInstanceName
@@ -505,7 +492,9 @@ static void validateCommonTlsContext(
505
492
.getDefaultValidationContext ();
506
493
}
507
494
if (certificateValidationContext != null ) {
508
- if (certificateValidationContext .getMatchSubjectAltNamesCount () > 0 && server ) {
495
+ @ SuppressWarnings ("deprecation" ) // gRFC A29 predates match_typed_subject_alt_names
496
+ int matchSubjectAltNamesCount = certificateValidationContext .getMatchSubjectAltNamesCount ();
497
+ if (matchSubjectAltNamesCount > 0 && server ) {
509
498
throw new ResourceInvalidException (
510
499
"match_subject_alt_names only allowed in upstream_tls_context" );
511
500
}
@@ -536,8 +525,6 @@ static void validateCommonTlsContext(
536
525
private static String getIdentityCertInstanceName (CommonTlsContext commonTlsContext ) {
537
526
if (commonTlsContext .hasTlsCertificateProviderInstance ()) {
538
527
return commonTlsContext .getTlsCertificateProviderInstance ().getInstanceName ();
539
- } else if (commonTlsContext .hasTlsCertificateCertificateProviderInstance ()) {
540
- return commonTlsContext .getTlsCertificateCertificateProviderInstance ().getInstanceName ();
541
528
}
542
529
return null ;
543
530
}
@@ -556,10 +543,6 @@ private static String getRootCertInstanceName(CommonTlsContext commonTlsContext)
556
543
.hasCaCertificateProviderInstance ()) {
557
544
return combinedCertificateValidationContext .getDefaultValidationContext ()
558
545
.getCaCertificateProviderInstance ().getInstanceName ();
559
- } else if (combinedCertificateValidationContext
560
- .hasValidationContextCertificateProviderInstance ()) {
561
- return combinedCertificateValidationContext
562
- .getValidationContextCertificateProviderInstance ().getInstanceName ();
563
546
}
564
547
}
565
548
return null ;
0 commit comments