use of io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.CommonTlsContext in project grpc-java by grpc.
the class ClientXdsClientDataTest method validateCommonTlsContext_validationContextProviderInstance.
@Test
@SuppressWarnings("deprecation")
public void validateCommonTlsContext_validationContextProviderInstance() throws ResourceInvalidException {
CommonTlsContext commonTlsContext = CommonTlsContext.newBuilder().setCombinedValidationContext(CommonTlsContext.CombinedCertificateValidationContext.newBuilder().setValidationContextCertificateProviderInstance(CertificateProviderInstance.newBuilder().setInstanceName("name1").build()).build()).build();
ClientXdsClient.validateCommonTlsContext(commonTlsContext, ImmutableSet.of("name1", "name2"), false);
}
use of io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.CommonTlsContext in project grpc-java by grpc.
the class ClientXdsClientDataTest method validateCommonTlsContext_combinedValidationContextWithDefaultValidationContextCrl.
@Test
@SuppressWarnings("deprecation")
public void validateCommonTlsContext_combinedValidationContextWithDefaultValidationContextCrl() throws ResourceInvalidException {
CommonTlsContext commonTlsContext = CommonTlsContext.newBuilder().setCombinedValidationContext(CommonTlsContext.CombinedCertificateValidationContext.newBuilder().setValidationContextCertificateProviderInstance(CommonTlsContext.CertificateProviderInstance.getDefaultInstance()).setDefaultValidationContext(CertificateValidationContext.newBuilder().setCrl(DataSource.getDefaultInstance()))).setTlsCertificateCertificateProviderInstance(CommonTlsContext.CertificateProviderInstance.getDefaultInstance()).build();
thrown.expect(ResourceInvalidException.class);
thrown.expectMessage("crl in default_validation_context is not supported");
ClientXdsClient.validateCommonTlsContext(commonTlsContext, ImmutableSet.of(""), false);
}
use of io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.CommonTlsContext in project grpc-java by grpc.
the class ClientXdsClientDataTest method validateCommonTlsContext_combinedValContextDfltValContextRequireSignedCertTimestamp.
@Test
@SuppressWarnings("deprecation")
public void validateCommonTlsContext_combinedValContextDfltValContextRequireSignedCertTimestamp() throws ResourceInvalidException {
CommonTlsContext commonTlsContext = CommonTlsContext.newBuilder().setCombinedValidationContext(CommonTlsContext.CombinedCertificateValidationContext.newBuilder().setValidationContextCertificateProviderInstance(CommonTlsContext.CertificateProviderInstance.getDefaultInstance()).setDefaultValidationContext(CertificateValidationContext.newBuilder().setRequireSignedCertificateTimestamp(BoolValue.of(true)))).setTlsCertificateCertificateProviderInstance(CommonTlsContext.CertificateProviderInstance.getDefaultInstance()).build();
thrown.expect(ResourceInvalidException.class);
thrown.expectMessage("require_signed_certificate_timestamp in default_validation_context is not " + "supported");
ClientXdsClient.validateCommonTlsContext(commonTlsContext, ImmutableSet.of(""), false);
}
use of io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.CommonTlsContext in project grpc-java by grpc.
the class ClientXdsClientDataTest method validateCommonTlsContext_tlsParams.
@Test
public void validateCommonTlsContext_tlsParams() throws ResourceInvalidException {
CommonTlsContext commonTlsContext = CommonTlsContext.newBuilder().setTlsParams(TlsParameters.getDefaultInstance()).build();
thrown.expect(ResourceInvalidException.class);
thrown.expectMessage("common-tls-context with tls_params is not supported");
ClientXdsClient.validateCommonTlsContext(commonTlsContext, null, false);
}
use of io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.CommonTlsContext in project grpc-java by grpc.
the class ClientXdsClientDataTest method validateCommonTlsContext_validationContextCertificateProvider.
@Test
@SuppressWarnings("deprecation")
public void validateCommonTlsContext_validationContextCertificateProvider() throws ResourceInvalidException {
CommonTlsContext commonTlsContext = CommonTlsContext.newBuilder().setValidationContextCertificateProvider(CommonTlsContext.CertificateProvider.getDefaultInstance()).build();
thrown.expect(ResourceInvalidException.class);
thrown.expectMessage("common-tls-context with validation_context_certificate_provider is not supported");
ClientXdsClient.validateCommonTlsContext(commonTlsContext, null, false);
}
Aggregations