【问题标题】:Https Proxy for Realm Object Server not working领域对象服务器的 Https 代理不起作用
【发布时间】:2017-03-22 13:25:23
【问题描述】:

我似乎无法运行我的领域对象服务器的 https 代理。我已经按照文档中的每个步骤进行操作,包括编辑 configuration.yml 文件以进行更改:

proxy.https.enable: true  
proxy.https.listen_address: ::  
proxy.https.listen_port: 9443  
proxy.https.certificate_path: 'cert_path'
proxy.https.private_key_path: 'private_key_path'

当我访问 http://example.com:9080 时没问题,但访问 https://example.com:9443 不起作用 - 我已验证路径正确,并且证书/私钥组合有效。

任何帮助配置它都将不胜感激,因为我正在努力使应用程序符合 Apple 的 ATS 要求!

【问题讨论】:

  • 您是如何获得 SSL 证书的?
  • @IanBradbury 我使用了 Comodo,但似乎我们的答案是有权限的!

标签: realm realm-mobile-platform realm-object-server


【解决方案1】:

Realm Object Server 由“realm”用户启动,您应该检查该用户是否有权访问证书。

这里是使用letsencrypt 设置 https 的说明列表!在 Ubuntu 16.04 上,也许它有助于识别您的问题:

  1. 安装 ROS,让我们加密并生成证书

curl -s https://packagecloud.io/install/repositories/realm/realm/script.deb.sh | sudo bash

apt-get install realm-object-server-developer
apt-get install letsencrypt

letsencrypt certonly --standalone -d ${mydomain.com}

# set up permissions for the realm user on /etc/letsencrypt.
sudo groupadd ssl
sudo usermod -a -G ssl realm
sudo chgrp -R ssl /etc/letsencrypt
sudo chmod -R g=rX /etc/letsencrypt
  1. 编辑配置以在“代理”部分启用 ssl

/etc/realm/configuration.yml中的部分:

  https:
    ## Whether or not to enable the HTTPS proxy module. It enables multiplexing requests
    ## by forwarding incoming requests on a single port to all services.
    ## Note that even if it enabled, the HTTPS proxy will only start if supplied
    ## with a valid pair of certificates through certificate_path and private_key_path below.
    enable: true

    ## The path to the certificate and private keys (in PEM format) that will be used
    ## to set up the HTTPS server accepting connections.
    ## These configuration options are MANDATORY to start the HTTPS proxy module.
    certificate_path: '/etc/letsencrypt/live/${mydomain.com}/cert.pem'
    private_key_path: '/etc/letsencrypt/live/${mydomain.com}/privkey.pem'

    ## The address/interface on which the HTTPS proxy module should listen. This defaults
    ## to 127.0.0.1. If you wish to listen on all available interfaces,
    ## uncomment the following line.
    listen_address: '::'

    ## The port that the HTTPS proxy module should bind to.
    # listen_port: 9443
  1. 连接到仪表板并创建一个帐户。 (转至https://${mydomain.com}:9443

  2. 转到浏览器并选择“连接到对象服务器” 输入 realms://${mydomain.com}:9443 作为 Server Url 以及您刚刚创建的用户名和密码。 您应该会看到一个领域列表。

【讨论】:

  • 你是“男人”。谢谢你。我有一个类似的问题(stackoverflow.com/questions/43034647/…)并且真的失败了。解决方案是权限。我什至从来没有考虑过。感谢您的提示。
  • 我也根本没有考虑权限。非常感谢!
  • 本教程非常棒。 Realm 应该把它放在他们网站的某个地方。谢谢! :)
  • 我建议设置 Certbot 以自动更新您的 LetsEncrypt SSL 证书:certbot.eff.org
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-02-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-10-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多