Interface ListenerTlsOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
ListenerTlsOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:38.681Z") @Stability(Stable) public interface ListenerTlsOptions extends software.amazon.jsii.JsiiSerializable
Represents TLS properties for listener.

Example:

 // A Virtual Node with listener TLS from an ACM provided certificate
 Certificate cert;
 Mesh mesh;
 VirtualNode node = VirtualNode.Builder.create(this, "node")
         .mesh(mesh)
         .serviceDiscovery(ServiceDiscovery.dns("node"))
         .listeners(List.of(VirtualNodeListener.grpc(GrpcVirtualNodeListenerOptions.builder()
                 .port(80)
                 .tls(ListenerTlsOptions.builder()
                         .mode(TlsMode.STRICT)
                         .certificate(TlsCertificate.acm(cert))
                         .build())
                 .build())))
         .build();
 // A Virtual Gateway with listener TLS from a customer provided file certificate
 VirtualGateway gateway = VirtualGateway.Builder.create(this, "gateway")
         .mesh(mesh)
         .listeners(List.of(VirtualGatewayListener.grpc(GrpcGatewayListenerOptions.builder()
                 .port(8080)
                 .tls(ListenerTlsOptions.builder()
                         .mode(TlsMode.STRICT)
                         .certificate(TlsCertificate.file("path/to/certChain", "path/to/privateKey"))
                         .build())
                 .build())))
         .virtualGatewayName("gateway")
         .build();
 // A Virtual Gateway with listener TLS from a SDS provided certificate
 VirtualGateway gateway2 = VirtualGateway.Builder.create(this, "gateway2")
         .mesh(mesh)
         .listeners(List.of(VirtualGatewayListener.http2(Http2GatewayListenerOptions.builder()
                 .port(8080)
                 .tls(ListenerTlsOptions.builder()
                         .mode(TlsMode.STRICT)
                         .certificate(TlsCertificate.sds("secrete_certificate"))
                         .build())
                 .build())))
         .virtualGatewayName("gateway2")
         .build();
 
  • Method Details

    • getCertificate

      @Stability(Stable) @NotNull TlsCertificate getCertificate()
      Represents TLS certificate.
    • getMode

      @Stability(Stable) @NotNull TlsMode getMode()
      The TLS mode.
    • getMutualTlsValidation

      @Stability(Stable) @Nullable default MutualTlsValidation getMutualTlsValidation()
      Represents a listener's TLS validation context.

      The client certificate will only be validated if the client provides it, enabling mutual TLS.

      Default: - client TLS certificate is not required

    • builder

      @Stability(Stable) static ListenerTlsOptions.Builder builder()
      Returns:
      a ListenerTlsOptions.Builder of ListenerTlsOptions