【问题标题】:How to configure ssl Certificate dropwizard on Localhost如何在 Localhost 上配置 ssl 证书 dropwizard
【发布时间】:2020-05-06 11:52:46
【问题描述】:

使用android okHttp需要https连接,否则无法使用,花了两天时间尝试可以使用http代替,但没有结果,对我没有任何效果

OkHttpClient            baseClient       = unidentifiedAccess.isPresent() ? connectionHolder.getUnidentifiedClient() : connectionHolder.getClient();
      OkHttpClient            okHttpClient     = baseClient.newBuilder()
              .connectionSpecs(Util.immutableList(ConnectionSpec.MODERN_TLS, ConnectionSpec.CLEARTEXT//CLEARTEXT
              ))
                                                           .build();

服务器位于我的 MAC 操作系统上。

服务器运行简单的jar,dropwizard框架。

运行时间: http://asylzat.com:8080/v1/directory/test

而我想要做的是使它 https 而不是 http:因为 okHttp 不能以其他方式工作。

我从 Reg.ru 购买了 ssl 证书,他们发给我两个文件:

  1. www.asylzat.com.key
  2. www.asylzat.com.csr

并且只有他们的托管服务器和 apachi 的说明。

我该怎么办?

这个ssl证书对我来说是一个巨大的,无法解决的问题,我试图弄清楚并解决它近四天,试图了解更多关于证书的信息。

dropwizard ssl

generating ssl certificate

没有结果,人手很多,csr,crt,keystore,pk12,jsr 都是一劳永逸的,不知道配置难不难,好像要全部学习一样,有点是系统管理员,但是是 ssl 管理员

任何知道的人,请帮助,我需要能够在https上运行dropwizard jar,这只是演示,只是因为adroid okhttp只接收https。这么小的员工,对我来说成了一个大问题,请帮忙!!!

REG.RU 只需给我发一封电子邮件:

_globalsign-domain-verification=mcd5zjYtpb7PT...

我不知道如何处理它,我问过 reg.ru,但他们回答说 “您的托管服务器不是我们的,所以我们无法帮助您”

.yml文件中有一个.keystore或者.jrs,它们是怎么做的?

【问题讨论】:

    标签: java ssl localhost okhttp dropwizard


    【解决方案1】:

    注意:评论太长了 使用证书和相关的东西需要一点学习。引用 Jetty 的文档:

    配置 SSL 可能会给密钥、证书、 协议和格式,因此它有助于有一个合理的 了解基础知识。

    Jetty 的文档试图对此有所帮助: Start from Understanding Cerificates and keys http://www.eclipse.org/jetty/documentation/current/configuring-ssl.html#understanding-certificates-and-keys 接下来检查Requesting a trusted certificate http://www.eclipse.org/jetty/documentation/current/configuring-ssl.html#requesting-trusted-certificate 在那里您将了解私有证书密钥如何帮助您创建 CSR(证书签名请求)。 此 CSR 由您的证书提供商处理以创建证书(文件)。 在Loading keys and certificates 中,您将学习以适合与您的 Java 应用程序一起部署的格式处理上述文件的基本步骤和命令。请仔细阅读。

    【讨论】:

      【解决方案2】:

      您是否尝试在自签名证书上启动服务器?

      keytool -keystore keystore -alias jetty -genkey -keyalg RSA -sigalg SHA256withRSA
      

      .yml 文件

      server:
      #  softNofileLimit: 1000
      #  hardNofileLimit: 1000
        applicationConnectors:
          - type: http
            port: 8080
          - type: https
            port: 8443
            keyStorePath: example.keystore
            keyStorePassword: example
      

      【讨论】:

      猜你喜欢
      • 2019-05-08
      • 1970-01-01
      • 2014-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-06
      • 2016-06-20
      • 2015-08-07
      相关资源
      最近更新 更多