如何刷新端口1337上的代理服务器的SSL证书?

时间:2018-10-23 02:45:15

标签: ssl ssl-certificate apache2

我有一个域,出于安全原因,我将其简称为“ example.org”,该域运行在我试图使SSL访问正常的Amazon EC2上。我正在使用letencrypt和certbot颁发我的证书。在开始尝试更新SSL证书之前的90天内,一切正常。我能够成功刷新我的域名的证书,但是由于某些原因,我似乎在端口1337上使用的代理服务器具有单独的证书,该证书显示为过期。

当我尝试在自己的网站上使用应用程序时,在浏览器的JavaScript控制台上看到以下错误:

example.org:1337 uses an invalid security certificate.

The certificate expired on Tuesday, October 9, 2018, 7:50 PM. The current time is Friday, October 19, 2018, 3:43 PM.

Error code: <a id="errorCode" title="SEC_ERROR_EXPIRED_CERTIFICATE">SEC_ERROR_EXPIRED_CERTIFICATE</a>
 (unknown) 

我的客户端应用是Angular 6 SPA,可直接与“ https://example.org:1337”通信。

使用SSL checker,我可以看到我的“ example.org”显示域级证书将在47天后过期。但是,当我检查“ example.org:1337”时,它说证书已在13天前过期。据我了解,每个域只需要一个SSL证书,而不必单独认证每个端口。我最初并未为端口1337请求证书,但在“ /etc/apache2/sites-available/000-default-le-ssl.conf”中确实为它指定了 proxyPass :< / p>

# allow us to call a node server without the user having to specify the port number 
# directly e.g. call the proxy server like it's a standard http route.
ProxyRequests off

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

<Location /servers/meta-data-proxy>
    ProxyPass https://localhost:1337
    ProxyPassReverse https://localhost:1337
</Location>

当我SSL检查我使用的另一个没有代理的端口时,它说“找不到ssl证书”,这是我期望的。

certbot显示以下证书:

> sudo certbot certifictes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: example.org
    Domains: example.org www.example.org
    Expiry Date: 2018-12-09 11:08:32+00:00 (VALID: 47 days)
    Certificate Path: /etc/letsencrypt/live/example.org/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/example.org/privkey.pem

我该怎么办:
a)刷新或同步端口1337上的证书以使其与域名上的证书同步?

b)不知何故删除了我计算机上端口1337上的过期证书。根据certbot,我没有在任何地方看到它。我希望通过删除它,可以以某种方式再次进行动态设置。

我甚至不确定我是否需要“ ProxyPass”。最初可能只是为了使工作正常进行,但这并不是我真正需要的。

Ubuntu 18.04 Apache2 2.4.29

1 个答案:

答案 0 :(得分:0)

对不起,每个人:该类别属于“不要介意/用户错误”类别。

结果证明我 did /etc/letsencrypt/live/example.org/fullchain.pem/etc/letsencrypt/live/example.org/privkey.pem复制到代理服务器的子目录中。然后,侦听端口1337的代理服务器将加载这些文件。一旦使用主https服务器使用的更新版本刷新了它们,一切都会恢复正常。因此,实际上,我确实有两个版本的密钥,您只能通过查看代码来弄清楚。

我真的不必记住要这样做,我会说这反映了我的应用程序设计不好。让客户端直接引用端口号可能不是一个好主意。我确实应该让客户端通过一个端口(例如443用于SSL)来引用服务器,然后让服务器决定重定向到任何内部服务器。我的应用程序最初只运行http,而我并没有真正考虑安全性。然后我在最后一秒添加了https。由于对SSL不太熟悉,所以我提出了比以前要难得多的问题,所以这就是我的辩护。 gh。