congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AuthenticationDataProvider.getTlsCertificates
Code IndexAdd Tabnine to your IDE (free)

How to use
getTlsCertificates
method
in
org.apache.pulsar.client.api.AuthenticationDataProvider

Best Java code snippets using org.apache.pulsar.client.api.AuthenticationDataProvider.getTlsCertificates (Showing top 7 results out of 315)

origin: apache/pulsar

  public void initChannel(SocketChannel ch) throws Exception {
    if (conf.isUseTls()) {
      SslContext sslCtx;
      // Set client certificate if available
      AuthenticationDataProvider authData = conf.getAuthentication().getAuthData();
      if (authData.hasDataForTls()) {
        sslCtx = SecurityUtility.createNettySslContextForClient(conf.isTlsAllowInsecureConnection(),
            conf.getTlsTrustCertsFilePath(), (X509Certificate[]) authData.getTlsCertificates(),
            authData.getTlsPrivateKey());
      } else {
        sslCtx = SecurityUtility.createNettySslContextForClient(conf.isTlsAllowInsecureConnection(),
            conf.getTlsTrustCertsFilePath());
      }
      ch.pipeline().addLast(TLS_HANDLER, sslCtx.newHandler(ch.alloc()));
      ch.pipeline().addLast("ByteBufPairEncoder", ByteBufPair.COPYING_ENCODER);
    } else {
      ch.pipeline().addLast("ByteBufPairEncoder", ByteBufPair.ENCODER);
    }
    ch.pipeline().addLast("frameDecoder", new LengthFieldBasedFrameDecoder(MaxMessageSize, 0, 4, 0, 4));
    ch.pipeline().addLast("handler", clientCnxSupplier.get());
  }
});
origin: apache/pulsar

if (authData.hasDataForTls()) {
  sslCtx = SecurityUtility.createNettySslContextForClient(tlsAllowInsecureConnection, tlsTrustCertsFilePath,
      authData.getTlsCertificates(), authData.getTlsPrivateKey());
} else {
  sslCtx = SecurityUtility.createNettySslContextForClient(tlsAllowInsecureConnection, tlsTrustCertsFilePath);
origin: org.apache.pulsar/pulsar-client-original

  public void initChannel(SocketChannel ch) throws Exception {
    if (conf.isUseTls()) {
      SslContext sslCtx;
      // Set client certificate if available
      AuthenticationDataProvider authData = conf.getAuthentication().getAuthData();
      if (authData.hasDataForTls()) {
        sslCtx = SecurityUtility.createNettySslContextForClient(conf.isTlsAllowInsecureConnection(),
            conf.getTlsTrustCertsFilePath(), (X509Certificate[]) authData.getTlsCertificates(),
            authData.getTlsPrivateKey());
      } else {
        sslCtx = SecurityUtility.createNettySslContextForClient(conf.isTlsAllowInsecureConnection(),
            conf.getTlsTrustCertsFilePath());
      }
      ch.pipeline().addLast(TLS_HANDLER, sslCtx.newHandler(ch.alloc()));
      ch.pipeline().addLast("ByteBufPairEncoder", ByteBufPair.COPYING_ENCODER);
    } else {
      ch.pipeline().addLast("ByteBufPairEncoder", ByteBufPair.ENCODER);
    }
    ch.pipeline().addLast("frameDecoder", new LengthFieldBasedFrameDecoder(MaxMessageSize, 0, 4, 0, 4));
    ch.pipeline().addLast("handler", clientCnxSupplier.get());
  }
});
origin: org.apache.pulsar/pulsar-proxy

  @Override
  protected void initChannel(SocketChannel ch) throws Exception {
    if (config.isTlsEnabledWithBroker()) {
      SslContext sslCtx;
      // Set client certificate if available
      AuthenticationDataProvider authData = authentication.getAuthData();
      if (authData.hasDataForTls()) {
        sslCtx = SecurityUtility.createNettySslContextForClient(config.isTlsAllowInsecureConnection(),
            config.getBrokerClientTrustCertsFilePath(),
            (X509Certificate[]) authData.getTlsCertificates(), authData.getTlsPrivateKey());
      } else {
        sslCtx = SecurityUtility.createNettySslContextForClient(config.isTlsAllowInsecureConnection(),
            config.getBrokerClientTrustCertsFilePath());
      }
      ch.pipeline().addLast(TLS_HANDLER, sslCtx.newHandler(ch.alloc()));
    }
    ch.pipeline().addLast("frameDecoder",
        new LengthFieldBasedFrameDecoder(PulsarDecoder.MaxFrameSize, 0, 4, 0, 4));
    ch.pipeline().addLast("proxyOutboundHandler", new ProxyBackendHandler(config, protocolVersion));
  }
});
origin: org.apache.pulsar/pulsar-proxy

  config.isTlsAllowInsecureConnection(),
  trustCertificates,
  authData.getTlsCertificates(),
  authData.getTlsPrivateKey()
);
origin: org.apache.pulsar/pulsar-client-original

if (authData.hasDataForTls()) {
  sslCtx = SecurityUtility.createNettySslContextForClient(tlsAllowInsecureConnection, tlsTrustCertsFilePath,
      authData.getTlsCertificates(), authData.getTlsPrivateKey());
} else {
  sslCtx = SecurityUtility.createNettySslContextForClient(tlsAllowInsecureConnection, tlsTrustCertsFilePath);
origin: org.apache.pulsar/pulsar-client-admin-original

if (authData.hasDataForTls()) {
  sslCtx = SecurityUtility.createSslContext(clientConfigData.isTlsAllowInsecureConnection(),
      trustCertificates, authData.getTlsCertificates(), authData.getTlsPrivateKey());
} else {
  sslCtx = SecurityUtility.createSslContext(clientConfigData.isTlsAllowInsecureConnection(),
org.apache.pulsar.client.apiAuthenticationDataProvidergetTlsCertificates

Popular methods of AuthenticationDataProvider

  • getHttpHeaders
  • getTlsPrivateKey
  • hasDataForHttp
    Check if data for HTTP are available.
  • hasDataForTls
    Check if data for TLS are available.
  • getCommandData
  • hasDataFromCommand
    Check if data from Pulsar protocol are available.

Popular in Java

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now