【问题标题】:Elasticsearch Python client SSLError on Mac OSXMac OSX 上的 Elasticsearch Python 客户端 SSLError
【发布时间】:2016-12-08 02:32:40
【问题描述】:

我们的 devops 最近在我们的内部 ElasticSearch 服务器上启用了 SSL,而我们的 Ubuntu 开发框连接到它很好,但它在 Mac 开发框(运行 Django)上导致 SSLError

SSLError at /search
ConnectionError(EOF occurred in violation of protocol (_ssl.c:590)) caused by: SSLError(EOF occurred in violation of protocol (_ssl.c:590))

到目前为止我所知道的:

  • 不仅限于 El Capitan,还打破了早期版本
  • 我们可以通过 https 连接到其他 ES 服务,我们的 devops 告诉我我们的 ES 服务有更高的 https 要求
  • Openssl v0.9.8 在 ES 服务上存在握手问题
  • Openssl v1.0.1 在 ES 服务上运行良好

网上有很多关于这个问题的帖子,但都没有帮助。

我试过了:

  • brew link --force openssl(但 EL Capitan 正在阻止它),Homebrew refusing to link OpenSSL 没有任何解决方案有效
  • /usr/local/opt/openssl/lib 添加到DYLD_LIBRARY_PATH
  • 将 python 从 2.7.10 升级到 2.7.12
  • 重建虚拟环境

以上都不起作用...

问题:

  • 是因为 OpenSSL 版本的原因吗?
  • 是不是因为Python版本的原因是_ssl.c?
  • 我该如何解决这个问题?

【问题讨论】:

    标签: python macos ssl urllib3


    【解决方案1】:

    终于搞定了,基本上你得安装更新了openssl的Python

    签入 Python cmd

    import ssl
    print ssl.OPENSSL_VERSION
    

    它应该打印 0.9.x

    现在更新:

    1. brew install openssl,如果链接被拒绝,不要担心链接,确保它是>=1.x.x
    2. 'brew install python --with-brewed-openssl`
    3. 通过指定 Python 的 brewed 版本重新创建 virtualenv,例如。 mkvirtualenv --python=/usr/.../Cellar/python/bin/python <project>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-19
      • 2016-11-21
      • 2015-03-29
      • 2017-07-05
      • 1970-01-01
      • 1970-01-01
      • 2016-09-28
      • 1970-01-01
      相关资源
      最近更新 更多