io.netty.handler.ssl.OpenSsl.supportsKeyManagerFactory()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(238)

本文整理了Java中io.netty.handler.ssl.OpenSsl.supportsKeyManagerFactory()方法的一些代码示例,展示了OpenSsl.supportsKeyManagerFactory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OpenSsl.supportsKeyManagerFactory()方法的具体详情如下:
包路径:io.netty.handler.ssl.OpenSsl
类名称:OpenSsl
方法名:supportsKeyManagerFactory

OpenSsl.supportsKeyManagerFactory介绍

[英]Returns true if javax.net.ssl.KeyManagerFactory is supported when using OpenSSL.
[中]如果是javax,则返回true。网ssl。使用OpenSSL时支持KeyManagerFactory。

代码示例

代码示例来源:origin: apache/qpid-jms

  1. /**
  2. * Determines if Netty OpenSSL support is available and applicable based on the configuration
  3. * in the given TransportOptions instance.
  4. *
  5. * @param options
  6. * The configuration of the Transport being created.
  7. *
  8. * @return true if OpenSSL support is available and usable given the requested configuration.
  9. */
  10. public static boolean isOpenSSLPossible(TransportOptions options) {
  11. boolean result = false;
  12. if (options.isUseOpenSSL()) {
  13. if (!OpenSsl.isAvailable()) {
  14. LOG.debug("OpenSSL could not be enabled because a suitable implementation could not be found.", OpenSsl.unavailabilityCause());
  15. } else if (options.getSslContextOverride() != null) {
  16. LOG.debug("OpenSSL could not be enabled due to user SSLContext being supplied.");
  17. } else if (!OpenSsl.supportsKeyManagerFactory()) {
  18. LOG.debug("OpenSSL could not be enabled because the version provided does not allow a KeyManagerFactory to be used.");
  19. } else if (options.isVerifyHost() && !OpenSsl.supportsHostnameValidation()) {
  20. LOG.debug("OpenSSL could not be enabled due to verifyHost being enabled but not supported by the provided OpenSSL version.");
  21. } else if (options.getKeyAlias() != null) {
  22. LOG.debug("OpenSSL could not be enabled because a keyAlias is set and that feature is not supported for OpenSSL.");
  23. } else {
  24. LOG.debug("OpenSSL Enabled: Version {} of OpenSSL will be used", OpenSsl.versionString());
  25. result = true;
  26. }
  27. }
  28. return result;
  29. }

代码示例来源:origin: org.apache.qpid/qpid-jms-client

  1. /**
  2. * Determines if Netty OpenSSL support is available and applicable based on the configuration
  3. * in the given TransportOptions instance.
  4. *
  5. * @param options
  6. * The configuration of the Transport being created.
  7. *
  8. * @return true if OpenSSL support is available and usable given the requested configuration.
  9. */
  10. public static boolean isOpenSSLPossible(TransportOptions options) {
  11. boolean result = false;
  12. if (options.isUseOpenSSL()) {
  13. if (!OpenSsl.isAvailable()) {
  14. LOG.debug("OpenSSL could not be enabled because a suitable implementation could not be found.", OpenSsl.unavailabilityCause());
  15. } else if (options.getSslContextOverride() != null) {
  16. LOG.debug("OpenSSL could not be enabled due to user SSLContext being supplied.");
  17. } else if (!OpenSsl.supportsKeyManagerFactory()) {
  18. LOG.debug("OpenSSL could not be enabled because the version provided does not allow a KeyManagerFactory to be used.");
  19. } else if (options.isVerifyHost() && !OpenSsl.supportsHostnameValidation()) {
  20. LOG.debug("OpenSSL could not be enabled due to verifyHost being enabled but not supported by the provided OpenSSL version.");
  21. } else if (options.getKeyAlias() != null) {
  22. LOG.debug("OpenSSL could not be enabled because a keyAlias is set and that feature is not supported for OpenSSL.");
  23. } else {
  24. LOG.debug("OpenSSL Enabled: Version {} of OpenSSL will be used", OpenSsl.versionString());
  25. result = true;
  26. }
  27. }
  28. return result;
  29. }

代码示例来源:origin: floragunncom/search-guard-ssl

  1. Throwable openSslUnavailCause = OpenSsl.unavailabilityCause();
  2. builder.field("ssl_openssl_non_available_cause", openSslUnavailCause==null?"":openSslUnavailCause.toString());
  3. builder.field("ssl_openssl_supports_key_manager_factory", OpenSsl.supportsKeyManagerFactory());
  4. builder.field("ssl_openssl_supports_hostname_validation", OpenSsl.supportsHostnameValidation());
  5. builder.field("ssl_provider_http", sgks.getHTTPProviderName());

代码示例来源:origin: eclipse/hono

  1. final boolean supportsKeyManagerFactory = OpenSsl.supportsKeyManagerFactory();
  2. final boolean useOpenSsl =
  3. getConfig().isNativeTlsRequired() || (isOpenSslAvailable && supportsKeyManagerFactory);

代码示例来源:origin: org.eclipse.hono/hono-service-base

  1. final boolean supportsKeyManagerFactory = OpenSsl.supportsKeyManagerFactory();
  2. final boolean useOpenSsl =
  3. getConfig().isNativeTlsRequired() || (isOpenSslAvailable && supportsKeyManagerFactory);

代码示例来源:origin: eclipse/hono

  1. final boolean supportsKeyManagerFactory = OpenSsl.supportsKeyManagerFactory();
  2. final boolean supportsHostnameValidation = OpenSsl.supportsHostnameValidation();
  3. final boolean useOpenSsl = isOpenSslAvailable && supportsKeyManagerFactory &&

代码示例来源:origin: org.eclipse.hono/hono-core

  1. final boolean supportsKeyManagerFactory = OpenSsl.supportsKeyManagerFactory();
  2. final boolean supportsHostnameValidation = OpenSsl.supportsHostnameValidation();
  3. final boolean useOpenSsl = isOpenSslAvailable && supportsKeyManagerFactory &&

相关文章